Prepare for React 19 with 18.3 warnings
Run your app on React 18.3, follow the development warning for ReactDOM.render, and migrate that entry point to createRoot before React 19.
You are preparing a React 18 app for React 19. Before changing the major version, bump both react and react-dom to 18.3 and start a development build. React can warn at the old call sites while they still work.
Follow the warning to the mount
Open a page that mounts a client-only React root. If its entry point calls ReactDOM.render, the app still appears. The development console asks you to switch to createRoot. It also tells you that a legacy root keeps React 17 behaviour until you migrate it.
import { createElement } from "react"
import ReactDOM from "react-dom"
const container = document.getElementById("root")
ReactDOM.render(createElement("button", null, "Save"), container)With a div whose id is root, you see the Save button and the legacy-render warning in the console.
React 19 removes ReactDOM.render. For this entry point, create the root once and then render into it. Keep the root reference if other code will render an update into the same container.
import { createElement } from "react"
import { createRoot } from "react-dom/client"
const container = document.getElementById("root")
const root = createRoot(container)
root.render(createElement("button", null, "Save"))Reload and the Save button appears without the legacy-render warning.
If the container holds React HTML from your server, use hydrateRoot for that entry point. Check where the HTML comes from before swapping the mount call. A page can have a client-only widget alongside parts rendered on the server.
Exercise the routes that mount their own roots
A quiet console on the home page covers the parts of the app you opened. Reload the widget page and any route that opens a separate React root. Use a development build for this pass so you can see development warnings.
If the warning appears and you cannot find an old render call in the entry point, expand the console stack and look for the first frame in your code or a dependency. A dependency may need an update before you can remove the legacy path. Once the call sites you found are clean on 18.3, switch to 19 and run the same flows again. The warnings give you places to start the upgrade. Your tests still have to catch failures that show up only after the switch.