- Actions: Automate handling of pending states, errors, forms, and optimistic updates using new hooks like
useTransitionanduseActionState. - New API:
use: Read resources in render, supporting conditional calls and promises. - Server Components and Server Actions: Enable async functions on the server, improving performance.
- Improved Hydration: Better error reporting and compatibility with third-party scripts.
- Enhanced Ref Handling: Simplified ref access and cleanup functions.
Getting started
React 19 Upgrade Guide
React 19 Upgrade Recipe
Migration Steps
1
Installation
Install stable React 19 and React DOM 19:or, if you’re using Yarn:
2
Update types (Optional - TypeScript only)
If you’re using TypeScript, install the stable React 19 types. Remove any temporary
npm:types-react@rc or npm:types-react-dom@rc aliases and corresponding overrides from your package.json first.3
Run codemods
Run the React 19 upgrade recipe:This recipe is a set of codemods that will fix some of React 19 breaking changes.The recipe includes the following codemods:
- react/19/replace-reactdom-render
- react/19/replace-string-ref
- react/19/replace-act-import
- react/19/replace-use-form-state
- react/prop-types-typescript
react-codemod repo.