The answer is “yes,” but we need to do a couple of things to make that happen. This post will show you what to do.
So let’s try using the ReactDOM.createRoot API. It’s this API that opts our application in to using React 18’s new features. We’ll open up index.tsx and make this change:
This is the TypeScript compiler complaining that it doesn’t know anything about ReactDOM.createRoot. This is because the type definitions that are currently in place in our application don’t have that API defined.
We might reasonably hope that everything should work now — alas, it does not. The same error is presenting. TypeScript is not happy.