Migrating to React v19.1.0
Version v19.1.0 introduces 4 breaking changes. This guide details how to update your code.
Released: 3/28/2025
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
captureOwnerStackuseIdReact.actuseEffectuseInsertionEffectuseLayoutEffectunstable_prerenderregisterServerReferenceSuspensePortalOffscreenComponentuse-sync-external-storeBreaking Changes
●Issue #1
React.act is no longer available in production builds; it is now strictly a development-only method.
●Issue #2
Removed support for using HTML comments (e.g. <!-- -->) as a DOM container for React DOM.
●Issue #3
The useId format has changed from ':r123:' to '«r123»' to ensure valid CSS selectors, which may affect CSS selectors relying on the old format.
●Issue #4
Updated the server component wire format to remove IDs for hints and console.log.
Migration Steps
- 1Ensure React.act is only used in test or development environments, as it is removed from production.
- 2Update any DOM mounting logic that relies on HTML comments as containers to use element nodes instead.
- 3Check CSS stylesheets or automated tests that might target useId generated IDs, as the string format has changed.
- 4If using use-sync-external-store with specific entrypoints, verify compatibility with the new exports field.
Release Summary
This release introduces Owner Stacks for enhanced development debugging and the experimental unstable_prerender API for Server Components. It also includes significant improvements to Suspense hydration, CSS-compliant useId formatting, and various bug fixes across React DOM and Server Components.
Need More Details?
View the full release notes and all changes for React v19.1.0.
View Full Changelog