Open Hubro opened 2 years ago
+1
+1
+1
Thanks for opening this issue, I was also unable to find where to ask about this issue since it could be related to react, react-router, and material 👍
If you have older version of npm, just try update npm to version > 8.0.0. It worked for me. I had npm version 6.x.x. I tried many solutions, but update npm fix this problem. Try check this stackoverflow thread - https://stackoverflow.com/questions/71791347/npm-package-cannot-be-used-as-a-jsx-component-type-errors/71838606#71838606.
If you have older version of npm, just try update npm to version > 8.0.0. It worked for me. I had npm version 6.x.x. I tried many solutions, but update npm fix this problem. Try check this stackoverflow thread - https://stackoverflow.com/questions/71791347/npm-package-cannot-be-used-as-a-jsx-component-type-errors/71838606#71838606.
I've tried to update but then I get other errors when running npm i
, It seems we've to update either the node version to LTS or update the package.json deps versions. Whatever the case I don't think this is a viable solution.
Checking the Stackoverflow link above, it seems like the solution would be to install NPM v8 or newer, then add to the package.json:
"overrides": {
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2"
}
I'll try it when I have time.
Using yarn v1: adding
"resolution": { "@types/react": "17.0.2" -> this is my version }
I deleted package-lock.json and then yarn add and yarn build and it works perfectly now.
I couldn't get "right from the examples, converted to TS" previously-compiling code for
I changed it to
(by hand. Probably should have found out the yarn cli magic I needed). But it builds now.
I'm using Next.js with React 17 and Material UI. I have installed
@types/react@17.0.2
manually. However, when I install@mui/material
, it pulls in@types/react-transition-group
, which in turn pulls in@types/react@18.0.1
. This doesn't match my React version, and it breaks my build at the type checking stage:I have no idea :confused: I have no idea which package to blame here, but I know
@types/react@18.0.1
should not be installed.