Upgrade to React 19
There are just two steps involved in updating an existing React application to version 19.
First step: install React 19.
Run the following from the terminal to install the most recent version from your project folder:
npm i react@latest react-dom@latest
Second step: Make use of the updated root API
You must use the new root API for client rendering in order to benefit from React 19’s concurrent features.
// Before
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Hello React!</h1>,
document.getElementById('root')
);
// After
import { createRoot } from 'react-dom/client';
createRoot(document.getElementById('root')).render(
<h1>Hello React!</h1>
);