Category "reactjs"

TypeError: history.push is not a function Why this show sometime

I don't understand why this error not come every time sometimes the code working and sometimes not working const dispatch = useDispatch() const userDetails = us

grammar & spell checking in nodejs

How to check spelling mistakes, grammar & punctuation errors, use of greetings & short keywords and total time to complete each single chat session in s

React custom mount hook

I always forget to add empty dependencies array in my useEffect hook in React to run the effect only once. That's why I decided to use a custom hook with a clea

warning after login .how to solve this error?

Cannot update a component (BrowserRouter) while rendering a different component (Login). To locate the bad setState() call inside Login, follow the stack trace

React UseEffect is being calling twice

I have the following code in FC component: I just want to call the Api and Log the info when the component is mounted The console.log is being called twice fo

onChange on TextInput Not Working Inside Formik

Generally <TextInput> allows you to type even when you're just specifying a placeholder. However, when using within the Formik form, I am unable to type a

Image in React component loading on one page but not the other one?

Hi guys very simple question. I have a home page and a room page. The question is why is the logo image in the navbar component loading in the homepage but not

TypeScript optional properties not accepting undefined value

<MyCustomField type={props.type} MyCustomField's type type definition: type?: string; props.type's type definition: type?: string; For some reason, I

NextJS Fast refresh not working as expected

I am building a website with nextjs and Chakra UI. I am using emotion to style my navigation. The code of navigation component is as follows: import Link from "

React i18next not working on Firefox/Microsoft Edge browser?

I am using React i18next library for localization in my application. Everything works fine when using the library on localhost, but when I produce a production

prop passed to child component not updated after async call

I am new to React and building a movie db app. I have defined my async fetch movies api call in API.js and call this in the Home.js components' useEffect and se

Is it is possible to test only one function from component with Jest?

I have react component, for example something like this: const MyComponent = (props) => { const [state, setState] = useState(true); const {data} = useCon

How to override Material UI .MuiContainer-maxWidthLg?

I'm trying to get rid of max-width that present in the theme. This is what I see in Chrome (and if I uncheck it, it does what I need): @media (min-width: 1280p

Bootstrap validation in a dual-purpose form not working

I have a form that is used for both Adding and Editing an Organisation. If the form is in Add mode (default) then you also create a default Admin user as part o

Detect React/ReactDOM development/production build

React development build behaves differently than production build, e.g. error handling. It can be figured out which one is used from the environment but only i

Problems with React Scroll and scroll-snap-type

I'm trying to use scroll-snap-type: y proximity;, but it isn't working well with react-scroll. I find that the page is scrolling in HTML tag and when I set over

create-react-app .env: process not defined

create-react-app is supposed to inject your .env variables into your React app. I have used the REACT_APP_ prefix with my variables in my .env and .env.developm

Uncaught Error: Shared module is not available for eager consumption in React module federation

consumes:146 Uncaught Error: Shared module is not available for eager consumption: webpack/sharing/consume/default/@emotion/react/@emotion/react?99ca at Obj

Optimize the display value in React Js

Please let me know how I can optimize more below code in one line: {addressToDisplay?.addressLineOne} {addressToDisplay?.addressLineTwo} {addressTo

Why is heroku giving error code H81 on deployment of react app

Im deploying full stack react app to heroku. I followed the steps provided on heroku using the cli -logged in using my credentials -ran heroku create -added