Open ajnozari opened 2 years ago
Same issue happening to me today
If I'm understanding this issue, it's due to an update to React to v18.
React-redux uses "*" for the type on @types/react
A workaround add :
"resolutions": {
"@types/react": "17.0.43"
}
to your package.json
try this:
"devDependencies": {
"@types/react": "18.0.0"
},
"@types/react": "17.0.43" tried but it doesn't work
Has anyone encountered this error?
For those who are using Yarn, as suggested by @ajnozari add the following to your package.json:
"resolutions": {
"@types/react": "17.0.44"
}
For those who are using npm version 8.3.0+ add the following to your package.json, remove node_modules and do npm install again:
"overrides": {
"@types/react": "17.0.44"
}
Both that options will force yarn or npm to install and use this specific version of react types for all installed packages. Note: version 17.0.44 is not mandatory, use any version you want, it just should be consistent in all places in your package.json. So in my case my package.json looks like this:
"devDependencies": {
"@types/react": "17.0.44"
},
"overrides": {
"@types/react": "17.0.44"
},
"resolutions": {
"@types/react": "17.0.44"
}
Same issue happening to me today
This worked for me, thanks @avasuro. Also I updated react-dom version :
"devDependencies": {
"@types/react": "17.0.44",
"@types/react-dom": "17.0.17",
},
"overrides": {
"@types/react": "17.0.44"
},
"resolutions": {
"@types/react": "17.0.44"
}
If I'm understanding this issue, it's due to an update to React to v18.
React-redux uses "*" for the type on @types/react
A workaround add :
"resolutions": { "@types/react": "17.0.43" }
to your package.json
This won't affect all your dependencies and make them resolve the React types from a version 17.0.43
when we actually want to update to React 18?
It seems more accurate to update react and react-dom types https://stackoverflow.com/a/71848896/1422380
This is a rather new issues that's suddenly popped up.
Previously working config now reports PersistGate is not a valid JSX component?