As of now react 18 has entered beta state.
I used npm install react@beta react-dom@beta to install beta version and then used npm install @types/react @types/react-dom --save-dev to install the types. I am following this article https://blog.logrocket.com/how-to-use-typescript-with-react-18-alpha/ except the part where it uses @next tag install react and react-dom. But when I checked inside node_modules/@types/react I cannot find next.d.ts file which was supposed to contain the updated definitions. Surprisingly I couldn't find a lot of information online about using typescript with latest react beta. Any help is appreciated, thanks.
How to install react beta types for typescript project?
390 Views Asked by smit At
2
From the current head commit in the
DefinitelyTypedrepository:@types/react/next.d.tslines 1–24: