I am trying to create react 18 app with TypeScript, I tried following this guide but I can't make it work. I can't add "types": ["react/next", "react-dom/next"] to tsconfig file. I'm getting error:
Cannot find type definition file for 'react-dom/next'.
The file is in the program because:
Entry point of type library 'react-dom/next' specified in compilerOptionsts
Cannot find type definition file for 'react-dom/next'.
The file is in the program because:
Entry point of type library 'react-dom/next' specified in compilerOptionsts
Also I can't import ReactDom from 'react-dom/client'; I'm getting this error:
Could not find a declaration file for module 'react-dom/client'. 'C:/Users/bansc/Desktop/youtube-channel/api-calls/my-app/node_modules/react-dom/client.js' implicitly has an 'any' type.
If the 'react-dom' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom'ts(7016)
node_modulesand runyarnagain. I recommend holding off on jumping on react 18 just yet, and just using thecreate-react-apptool with typescript support. It looks like the team behind create-react-app, are already getting it ready to support react 18, and they will have an upgrade guide to follow when it is ready