After React 18 is official I started upgrading several of my projects to the latest and here is my experience with the upgrade
September 19, 2024
One day after React 18 is official I was so excited to start exploring the new features and then I decided to upgrade the current code of my SplittaExpens app to the latest react. So here is my story of the upgrading
I upgraded from React 17.0.2 and react-scripts 5.0.0. So here are the following dependencies I need to upgrade
I realized that react-spring 9.4.3 does not work with React 18 so I removed that for now
You need to update your rendering root to the new client so it will support the new features.
import * as ReactDOM from "react-dom/client";
const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(<React.StrictMode><App /></React.StrictMode>);
So far my app still works as it should and the feature I expect most is state updates will be batched automatically and it works as it should which is really nice.
I have problems with using the new hooks useTransition and useDeferredValue as typescript complaints about that it cannot find them in react. I am not sure it is problem of my editor or react is lacking definitions for them in typescript.
I have tried anyway useTransition and useDeferredValue in a new create-react-app with ts-nocheck