Category "reactjs"

Implementing a countdown timer in React with Hooks

Im trying to render a count down timer on screen with react hooks, but I'm not sure the best way to render it. I know i'm supposed to use the useEffect to comp

React-router did not work on production

there, I am using react-router for this app. It works fine on my local server. Here is the code: var routes = ( <Router history={browserHistory}> <

React functional component - is it possible to pass props to { children }? [duplicate]

Workaround at the bottom of the question. I am trying to pass props down to a child component using {children}. The Father component: const Fa

How to check for esim eligibility in react-native app?

I need to make a react-native app that checks if the device is suitable for esim or not. I obtain this information https://source.android.com/devices/tech/conn

How to check for esim eligibility in react-native app?

I need to make a react-native app that checks if the device is suitable for esim or not. I obtain this information https://source.android.com/devices/tech/conn

React functional component - is it possible to pass props to { children }? [duplicate]

Workaround at the bottom of the question. I am trying to pass props down to a child component using {children}. The Father component: const Fa

How can i increase Material UI overall animation speed

How can i increase the overall animation speed of Material UI, for example there is a drawer component inside the material UI, and it can be opened or closed, h

Testing asynchronous useEffect

My functional component uses the useEffect hook to fetch data from an API on mount. I want to be able to test that the fetched data is displayed correctly. Whi

How to access one component's state from another component

How do I access one component's state in another component? Below is my code and I'm trying to access the state of component a in component b. var a = React.cr

Jest testing react component with react-intersection-observer

I'm trying to test a component that has a child component that includes react-intersection-observer but I always get an error I tried to import the library bu

Theme nesting with Material UI

I have many datatables throughout my website and for the most part they are all styled the same. There are several different styles I need to apply to some of t

yarn install failing import sys; print "%s.%s.%s" % sys.version_info[:3] invalid syntax

When doing yarn install i get this error, but no issues one other projects, also used Brew to install node. Note sure what else should i try, any suggestions? e

AWS elastic beanstalk - WARN install EACCES: permission denied, access '/tmp/.npm'

Can anyone help me to get rid out of the following error - WARN install EACCES: permission denied, access '/tmp/.npm' gyp ERR! clean error gyp ERR! stack

react router v6 navigate outside of components

In react-router v5 i created history object like this: import { createBrowserHistory } from "history"; export const history = createBrowserHistory(); And then

Module not found: Can't resolve "NPM LINKED MODULE" when using npm-link

I'm working on a TypeScript React application which heavily relies on a private NPM package. I can successfully link the NPM package, but after doing so I get t

Google Direction service plotting unexpected route

I have an asset i.e. a truck generating reads (lat, lng) at a specific interval and I am plotting those reads on maps using direction service api But direction

You cannot render a <Router> inside another <Router>. You should never have more than one in your app

import { BrowserRouter, Routes, Route } from "react-router-dom"; //Layouts import HomeLayoutRoute from "./components/layouts/HomeLayout"; //components import

react-number-format: Setting Default Value

I have the following: <NumberFormat allowNegative={false} label="Serves" customInput={TextField} variant="outlined" name="serves" value={serves} thousandSep

Using webpack to load CSS files from node modules

I'm trying to use a react component that includes a css file. I'm requiring the component as usual: var Select = require('react-select'); I'd like to know ho

react router's location state becomes undefined on change of route

I want to store url query as a state on location. ~ history.push({ + ...history.location, + search: query.toString(), + state: { + myState