PersistGate' cannot be used as a JSX component. Its instance type 'PersistGate' is not a valid JSX element.
I get the error below in my App.tsx file after I have implemented data persistance with redux
'PersistGate' cannot be used as a JSX component.
Its instance type 'PersistGate' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types
Admin
2023-04-16
Quick fix for this is to add the following to your package.json file
If you're using Yarn
..............
"resolutions": {
"@types/react": "^17.0.39"
}
................
If you're using NPM
"overrides": {
"@types/react": "17.0.39"
}
Ensure that the version is the same in your dependecies and dev dependencies list.
Finally execute yarn or npm install again so it will download the package.
And that's all, hope this helps in fixing your error.
Similar Content
- How to use external stylesheets in next.js
- How to setup a copy to clipboard functionality in either react.js or next.js site
- Error: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render. react-hooks/rules-of-hooks
- How to destructure objects with typescript in next js.
- How to read system images in an electron-react app
Add Message
Click on the button below to add a new message to this thread
Tags
#Javascript
Thread detail
Satus: Open
Messages: 1Started: 2023-04-16Thread Create
Click the button below to start a new thread for your question
loading..
Privacy Policy
By using our website,
you agree that devmaesters can store cookies on your device and disclose information in accordance with our privacy policy.