To upgrade an existing React application to version 18, follow two simple steps. If you’re already using the latest version of create-react-app with React 18, you can skip this part.
To install the latest version, run the following command from your project folder in the terminal:
npm i react@latest react-dom@latest |
To utilize React 18’s concurrent features, you’ll need to use the new root API for client rendering.
// Before // After |