Category "reactjs"

Create a static library with React dependency

I created a library that uses the native navigation controller to navigate through react and native screens. The library is written in Swift and contains some o

what is difference between variant vs component in typography for library React Material UI

I am using React Material UI component. Typography component has 2 props, variant and component.What is the difference between these props.

Handle change on Autocomplete Component from material ui

I want to use Autocomplete component for input tags. I'm trying to get the tags and save them on a state so I can later save them on the database. I'm using fun

How could we pass FileReader's result to parent's state in React?

Hello and thank you for your time. I am currently learning React. I am trying to refactor a component to separate and put the state into a top level component

how to pass data from one page to another page in Next.js?

I am stuck with a problem with passing data from one page to another page in next.js as I am building a basic news application in which I am fetching get reques

Redirect to docs from landing page in docusaurus v2

Since I don't have a landing page, I would like to redirect to the main doc page docs/main I tried to follow the instructions: https://docusaurus.io/docs/en/si

React PDF + Vite implementation Error: Uncaught SyntaxError

I'm trying to use the React PDF lib in a project that react created with Vite. I'm having problems rendering the PDF component and the error is very weird, coul

wallet-connect importKey error when uploaded to test server, but local server it works fine

I was trying out wallet-connect for my nft market place app . i have mostly everything set up from my end . Just that my wallet-connect works perfectly in local

Node Error: resolve-url-loader: CSS error

I am trying to run a react project as dev server on my surface, and if gives me the error shown below and in the title. When I am running the same config on my

Google Tag Manager Form Submission with Formik

Try as I may, I am unable to successfully track any form submissions with Google Tag Manager when the form is submitted by Formik in a React project. I have tr

Combining 2 arrays into their own arrays React

I have 2 arrays that I used the map() function to add to an array, but the problem I'm having is they are being grouped by name and grouped by review but I want

React Native Firestore getting data problem

When I try to access the data from a Firestore collection called 'Targets' it returns: {"_U": 0, "_V": 0, "_W": null, "_X": null} my firestore item is: item pho

Yup / Formik async validation with debounce

How can debounce be applied to the async validation below (code from Yup's github) ? let asyncJimmySchema = string().test( 'is-jimmy', '${path} is not Jimm

Does React keep the order for state updates?

I know that React may perform state updates asynchronously and in batch for performance optimization. Therefore you can never trust the state to be updated afte

React + Material UI - Best way to prevent child tree from remount when toggling parent theme

Background I wanted to follow Material UI's implementation of toggling UI's dark/light mode theme. Link. I have encapsulated its implementation into a custom ho

How to use jest to mock out a private variable

I am trying to write a unit test for a function like this: export class newClass { private service: ServiceToMock; constructor () { this.service =

type for useRef if used with setInterval, react-typescript

I am doing a simple animation in a next.js app. let flipInterval = useRef(); const startAnimation = () => { flipInterval.current = setInterval(() =>

Functions are not valid as a React child. This may happen if you return a Component instead of from render

I have written a Higher Order Component: import React from 'react'; const NewHOC = (PassedComponent) => { return class extends React.Component {

Can I use React Bootstrap with Next.js?

Does anyone know if you can use react-bootstrap with Next.js? I am using the latest versions of both, I can provide code at this point, but right now my app is

Only postive integers in input field in react

I have a input field for price and quantity and I want to restrict it to have only +ve integers. I don't want to do any kind of validation like the type=number