React 19 upgrade guide: the order of work for a production app

Most teams that put off the move to React 19 had a sensible reason. A dependency wasn't ready, or nobody wanted to touch ReactDOM.render in a codebase that worked. By October 2026 that reason has expired. React 19 has gone from 19.0 to 19.3, and the current stable version on npm is React 19.3.1, published on October 14, 2026.
This React 19 upgrade guide is the order of work we'd follow on a production application. It covers what to check first, the commands to run, the APIs to replace by hand and how to test. The release features come after the steps, because they're the reward, not the plan.
Four checks before you follow this React 19 upgrade guide
Your current version. If you're on React 18.2 or older, you'll make two moves, not one. The React team's React 19 upgrade guide asks you to go to React 18.3 first. It's identical to 18.2 but logs warnings for every deprecated API that React 19 removes.
Your build setup. React 19 needs the modern JSX transform that arrived in 2020. Most toolchains already use it. If yours doesn't, you'll see an "outdated JSX transform" error on the first run.
Your framework. If you started on Create React App, note that the React team deprecated it for new apps in February 2025. It still works in maintenance mode, and a version was published for React 19. Still, the team recommends moving to a framework (Next.js, React Router, Expo) or a build tool (Vite, Parcel, Rsbuild). Do that move as its own project, before or after the React upgrade, never in the same pull request.
Whether you use Server Components. If your app renders React Server Components through Next.js App Router, React Router or a bundler plugin, step 8 is not optional.
Step 1: Choose the latest version or an earlier minor
For a new upgrade in late 2026, the React version to aim for is 19.3. It's the line where new features land, and 19.3.1 is the latest version. React also published patch releases for the 19.0, 19.1 and 19.2 lines on the same day, so teams that have to stop at an earlier minor still get fixes.
A plain npm install react@19 react-dom@19 takes the newest 19.x, but pin the exact version instead. The upgrade guide itself uses --save-exact, and it's good practice when you want to know which React you shipped:
npm install --save-exact [email protected] [email protected]
If you use TypeScript, update the types in the same commit. Both @types/react and @types/react-dom are at 19.3.0 on npm:
npm install --save-exact @types/[email protected] @types/[email protected]
Keep react and react-dom on the same version. The React team's own security advisory warns that a mismatch between them causes an error.
Step 2: Go to React 18.3 and clear every warning
Install [email protected] and [email protected], run the app and your test suite, and read the console. Each warning helps you identify a deprecated feature that React 19 deletes: string refs, legacy context, defaultProps on function components, ReactDOM.render and so on.
Fix these on 18.3, where the app still runs. It's far easier to fix a warning than a crash. If you can, ship 18.3 to production on its own. Small increments make it obvious which change caused a regression.
Step 3: Run the codemods
The React team maintains codemods that handle most of the mechanical changes. One recipe runs the main set:
npx codemod@latest react/19/migration-recipe
That recipe runs replace-reactdom-render, replace-string-ref, replace-act-import, replace-use-form-state and prop-types-typescript. You can also run each one on its own, for example npx codemod@latest react/19/replace-string-ref.
TypeScript projects need a second pass with the types codemod:
npx types-react-codemod@latest preset-19 ./path-to-app
Review the diff before you commit it. Codemods are fast and literal, and they don't know which component is a test fixture.
Step 4: Replace the removed APIs by hand
Whatever the migration recipe missed, you'll find here. These deprecated APIs are gone in React 19:
| Removed in React 19 | Replace it with |
|---|---|
ReactDOM.render |
createRoot from react-dom/client, then root.render() |
ReactDOM.hydrate |
hydrateRoot from react-dom/client |
unmountComponentAtNode |
root.unmount() |
ReactDOM.findDOMNode |
A DOM ref (useRef) |
propTypes checks |
TypeScript or another type checker (React now ignores them silently) |
defaultProps on function components |
ES6 default parameters (class components keep defaultProps) |
Legacy context (contextTypes, getChildContext) |
createContext and static contextType |
| String refs | Ref callbacks |
React.createFactory and module pattern factories |
Plain JSX and regular functions |
act from react-dom/test-utils |
act from react |
react-test-renderer/shallow |
The react-shallow-renderer package, or better, React Testing Library |
| UMD builds | An ESM-based CDN such as esm.sh |
The React docs show a before-and-after example for each one. The root API change is the one almost every older app needs:
// Before (React 17 and earlier)
import { render } from 'react-dom';
render(<App />, document.getElementById('root'));
// After (React 19)
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root'));
root.render(<App />);
Watch propTypes closely. Nothing breaks when React stops reading them, so a component that relied on them for runtime checks just loses that safety without a sound.
Step 5: Fix the TypeScript errors
The new types are stricter, so expect compile errors here. The common ones:
useRef()needs an argument. WriteuseRef(null)oruseRef(undefined). All refs are now mutable, anduseRefreturnsRefObject.- Ref callbacks can't return a value implicitly. React 19 treats a returned function as a cleanup, so change
ref={el => (node = el)}toref={el => { node = el }}. ReactElementprops default tounknown, notany. Pass an explicit type argument where you readelement.props.- The global
JSXnamespace is gone. Move custom element declarations insidedeclare module "react"(or the runtime module yourjsxsetting uses). useReducertyping changed. Let TypeScript infer the types, or pass the state and action types directly.
Step 6: Update error handling and reporting
This is the step that bites quietly. React 19 no longer re-throws errors caught during render. Uncaught errors now go to window.reportError, and errors caught by an Error Boundary go to console.error.
If your monitoring tool relied on the old re-throw, hook it into the new root options:
const root = createRoot(container, {
onUncaughtError: (error, errorInfo) => {
// send to your error tracker
},
onCaughtError: (error, errorInfo) => {
// send to your error tracker
},
});
hydrateRoot takes the same options. Check that errors still arrive in your dashboard before you ship, not after.
Step 7: Test the behavior changes and monitor performance
A clean build doesn't mean identical behavior. Plan test time for these:
- Strict Mode. In development, React now double-invokes ref callbacks on first mount. React 19.3 also double-invokes effects during hydration, to match client-rendered roots.
- Suspense. When a component suspends, React commits the nearest fallback right away instead of waiting for its siblings to render.
- Tests built on
react-test-renderer. The package is deprecated and logs a warning. The React team recommends moving to React Testing Library. element.ref. Reading it logs a warning, becauserefis now a regular prop. Useelement.props.ref.- Speed. React 19.2 added Performance Tracks to Chrome DevTools. They show scheduler priorities and the component tree React is rendering, so you can compare a profile before and after the upgrade.
Libraries and other dependencies can be the slowest part. Any package that reaches into React internals may break, so run npm ls react and check that each UI library is compatible with React 19 before you merge.
Step 8: Patch Server Components if you use them
In December 2025, the React team disclosed CVE-2025-55182, a remote code execution flaw in React Server Components rated CVSS 10.0. Denial-of-service and source-exposure issues followed, the last one disclosed on January 26, 2026.
The fixed versions are 19.0.4, 19.1.5 and 19.2.4 or later. The affected packages are react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack, which ship inside frameworks such as Next.js and React Router. Apps that don't use a server aren't affected. If yours does, upgrade the framework too, not just React.
What the upgrade gets you: React 19 release features by version
React 19 first shipped as a beta on April 25, 2024, the same day as the official upgrade guide. The stable release followed on December 5, 2024, with Server Components marked stable for app code. Each minor release since then has added features, so one upgrade to 19.3 gets you all of them, including the latest features from September 2026.
| Release | Features worth knowing |
|---|---|
| 19.0 (Dec 2024): data and forms | Actions, useActionState, useFormStatus, useOptimistic, use, form action props |
| 19.0 (Dec 2024): rendering | ref as a prop, <Context> as a provider, document metadata, stylesheet precedence, preloading APIs, custom elements |
| 19.1 (Mar 2025) | Owner Stacks for debugging (captureOwnerStack, development only) |
| 19.2 (Oct 2025) | <Activity>, useEffectEvent, cacheSignal, Performance Tracks in Chrome DevTools, Partial Pre-rendering |
| 19.3 (Sep 2026) | <ViewTransition> and addTransitionType (stable), Fragment refs, browser() in react-dom, Trusted Types support, <Context> rendered directly in Server Components |
Actions and the form hooks
Actions are the change you'll feel first. You can pass an async function to startTransition, and React tracks the pending state, errors and optimistic updates for you. Actions also simplify form handling: <form action={fn}> accepts a function, and React resets uncontrolled fields after a successful submit. useActionState wraps the pattern into one hook:
const [error, submitAction, isPending] = useActionState(
async (previousState, newName) => {
const error = await updateName(newName);
if (error) return error;
return null;
},
null,
);
useFormStatus, imported from react-dom, lets a submit button read its parent form's pending state without prop drilling. useOptimistic shows the expected result while the request runs, then switches back if it fails. The new use API reads a promise or a context during render, and unlike hooks it can be called inside a condition. For data fetching, it expects promises from a Suspense-aware library or framework that caches them. If your old code used useFormState, note that it was renamed to useActionState and the old name is deprecated.
Less wrapper code
Function components now take ref as a normal prop, so new code doesn't need forwardRef. You can render <ThemeContext value="dark"> instead of <ThemeContext.Provider>. Both old forms still work in 19.3, but the React team plans to deprecate them.
Metadata, stylesheets and asset loading
You can render <title>, <meta> and <link> inside any component, and React hoists them into the document head. That removes the need for a helper library in simple cases. It doesn't replace a technical SEO review of what search engines actually receive.
Stylesheets accept a precedence prop, and React holds back content until the stylesheet it depends on has loaded. The prefetchDNS, preconnect, preload and preinit functions from react-dom let you tell the browser about fonts, scripts and styles early. preload fetches a resource for later; preinit fetches and executes it right away.
The latest features in 19.3
<ViewTransition> animates elements with the browser's View Transition API when they enter, exit or change during a transition. The default is a cross-fade, and you can customize it with CSS classes or the Web Animations API. Fragment refs let you focus, observe or attach events to a group of child elements without adding a wrapper <div>. The new browser() API lets a component opt out of server rendering cleanly, replacing the familiar typeof window checks.
How does React enable faster development cycles?
It's a fair question, and the answer is less about any single release than about how React is built. Three things save developers the most time:
- Components you reuse. React components are plain JavaScript functions. You build a button, form or card once and use it everywhere, so changes happen in one place.
- Fast feedback while you code. In React Native, Fast Refresh is on by default, and most edits show up within a second or two while local state is kept. On the web, Next.js uses Fast Refresh too.
- Less code to write and review. Actions and the form hooks replace hand-written loading and error state. The React Compiler, stable since October 2025, memoizes components at build time, so you write fewer
useMemoanduseCallbackcalls.
Where the React Compiler fits
The compiler also has a performance story. On the Meta Quest Store, the React team reports initial loads and cross-page navigations improved by up to 12%, and some interactions became more than 2.5× faster. The same post says results vary by app, so measure yours. The compiler works with React 17 and up, and React 19 doesn't require it. Treat it as a separate rollout once the upgrade is stable.
When something breaks
An error about an outdated JSX transform. Your Babel or TypeScript config still uses the classic runtime. Switch to the automatic JSX runtime, then rebuild.
A component lost its default values. It was a function component with defaultProps. Move the defaults into the parameter list: function Heading({ text = 'Hello' }).
Errors stopped reaching your monitoring tool. See step 6. Add onUncaughtError and onCaughtError to createRoot or hydrateRoot.
A UI library crashes on import. It probably depends on React internals or a removed API. Check for a React 19 release of that library before you write a workaround.
Hydration errors look different. That's an improvement. React 19 logs one error with a diff of the server and client output instead of several vague warnings. It also skips unexpected tags that third-party scripts and browser extensions insert, so those no longer cause mismatch errors.
Plan the upgrade around your release calendar
For a small app, most of the work is the codemods and a test pass. For a large codebase, budget time for the 18.3 cleanup, the TypeScript errors and the library audit, and schedule the release away from your peak traffic. Teams that also ship React Native apps get React 19 from React Native 0.78 onward, so that upgrade runs on its own track. The React Native guide covers that side.
If you're also deciding whether to move to a framework while you're at it, the comparison of Next.js vs React lays out the tradeoff. To hand off the audit, Brainvire's React development team can start with the inventory. That means every 18.3 warning, every library without React 19 support and every Server Components package that needs a patch.
FAQ
Can I upgrade from React 17 straight to React 19?
Yes, but go through React 18.3 on the way. The React team recommends 18.3 because its warnings flag the APIs that React 19 removes. Coming from 17, you'll also replace ReactDOM.render with createRoot, which the codemod handles for most apps.
Do I have to rewrite class components for React 19?
No. Class components are still supported and keep defaultProps. You only need to change the removed patterns inside them, such as string refs and legacy context, and the codemods handle string refs for you.
Is forwardRef deprecated in React 19?
Not yet. It still works, but new function components can take ref as a regular prop, so forwardRef isn't needed. The React team has said it will deprecate and later remove forwardRef, so new code shouldn't use it.
Who maintains React now?
The React Foundation, an independent foundation hosted by the Linux Foundation, which launched on February 24, 2026. React, React Native and JSX moved there from Meta. The people who maintain React still set its technical direction, and nothing changed in how you install or use it.
Related reading
Embedded systems programming: how firmware is structured, written and testedJuly 28, 2021 · 12 min read
eLearning management systems: 18 LMS platforms grouped by who you trainDecember 16, 2024 · 13 min read