React 18 typescript problem
See original GitHub issueReact has tightened it¤s typing restrictions in v18 and as a result there are a several typescript errors in the project:
TS2786: 'Saturation' cannot be used as a JSX component.
<e> Its instance type 'Saturation' is not a valid JSX element.
<e> The types returned by 'render()' are incompatible between these types.
<e> Type 'import("/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
<e> TS2786: 'Hue' cannot be used as a JSX component.
<e> Its instance type 'Hue' is not a valid JSX element.
<e> The types returned by 'render()' are incompatible between these types.
<e> Type 'import("/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
Issue Analytics
- State:
- Created a year ago
- Reactions:25
- Comments:11
Top Results From Across the Web
Bug: React 18 types broken since the type release a ... - GitHub
I want to reiterate that using TypeScript is a choice. You don't have to use React with TypeScript. If you choose to use...
Read more >How to use TypeScript with React 18 alpha - LogRocket Blog
This is the TypeScript compiler complaining that it doesn't know anything about ReactDOM.createRoot . This is because the type definitions that ...
Read more >Upgrading to react@18 and react-dom@18 fails
So, I went back and created a brand new app with npx create-react-app react18 --template typescript . It now wants react@18 and react-dom@18...
Read more >React sur Twitter : "The React 18 TypeScript typings are out ...
There is an automated migration script that you can use to update your application code. It helps fix the most common issues when...
Read more >Strict Mode - React
To help surface these issues, React 18 introduces a new development-only check to Strict Mode. This new check will automatically unmount and remount...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The same with
SketchPicker
so it looks like all exported sub-components are affected 😭The working solution: add in package.json
For anyone still wondering about this one, RE-INSTALL the packages after adding the resolutions is the key to get this working.
Package.json (excerpt)