react
19.3.1 · 14 Oct 2026MIT275.7M / weekRepositoryHomepagenpmAtom feed
19.3.1 is the newest release of 19.x.
Summary· from the note as AI read it
Migration neededRead before upgrading: 10 changes to make.
Before you upgrade
- Uncaught render errors no longer rethrown; use onUncaughtError/onCaughtError if needed
- propTypes are ignored; migrate to TypeScript or another type checker
- Replace defaultProps on function components with ES6 default parameters
- Migrate legacy contextTypes/getChildContext to the contextType API
- Migrate string refs to ref callbacks
- Migrate module pattern factories to regular function components
- Replace React.createFactory calls with JSX
- Check ref callbacks tolerate double invocation in StrictMode
New minimums
- Configure your build to use the new JSX transform
- Load React via an ESM-based CDN instead of UMD builds
Deprecated
- Stop accessing element.ref; read ref from props instead
- Pass key explicitly instead of spreading it with props
New
- Actions:
startTransitioncan now accept async functions. Functions passed tostartTransitionare called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects likefetch()in the pendi useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a formactionprop to support progressive enhancement in forms.useOptimistic: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.use: is a new API that allows reading resources in render. In React 19,useaccepts a promise or Context. If provided a promise,usewill suspend until a value is resolved.usecan only be used in render but can be called conditionally.refas a prop: Refs can now be used as props, removing the need forforwardRef.
In short
7 breaking15 removed2 deprecated25 new6 faster16 fixed
- Breaking
New JSX Transform is now required: We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
- Breaking
Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced
onUncaughtErrorandonCaughtErrormethods tocreateRootandhydrateRootto customize this error handling. - Breaking
StrictMode changes:
useMemoanduseCallbackwill now reuse the memoized results from the first render, during the second render. Additionally, StrictMode will now double-invoke ref callback functions on initial mount. - Breaking
Don’t rethrow errors at the root
- Breaking
Refs are now attached/detached/attached in StrictMode
- Breaking
Reuse memoized result from first pass
- Breaking
Rename the
react.elementsymbol toreact.transitional.element - Removed
Removed:
propTypes: UsingpropTypeswill now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
Release note
The section about react of a note shared by several packages.
New Features
React
Actions:
startTransitioncan now accept async functions. Functions passed tostartTransitionare called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects likefetch()in the pending state, and provides support for error handling, and optimistic updates.useActionState: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a formactionprop to support progressive enhancement in forms.useOptimistic: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.use: is a new API that allows reading resources in render. In React 19,useaccepts a promise or Context. If provided a promise,usewill suspend until a value is resolved.usecan only be used in render but can be called conditionally.refas a prop: Refs can now be used as props, removing the need forforwardRef.Suspense sibling pre-warming: When a component suspends, React will immediately commit the fallback of the nearest Suspense boundary, without waiting for the entire sibling tree to render. After the fallback commits, React will schedule another render for the suspended siblings to “pre-warm” lazy requests.
Breaking Changes
React
- Breaking
New JSX Transform is now required: We introduced a new JSX transform in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
- Breaking
Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced
onUncaughtErrorandonCaughtErrormethods tocreateRootandhydrateRootto customize this error handling. - Breaking
Removed:
propTypes: UsingpropTypeswill now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution. - Breaking
Removed:
defaultPropsfor functions: ES6 default parameters can be used in place. Class components continue to supportdefaultPropssince there is no ES6 alternative. - Breaking
Removed:
contextTypesandgetChildContext: Legacy Context for class components has been removed in favor of thecontextTypeAPI. - Breaking
Removed: string refs: Any usage of string refs need to be migrated to ref callbacks.
- Breaking
Removed: Module pattern factories: A rarely used pattern that can be migrated to regular functions.
- Breaking
Removed:
React.createFactory: Now that JSX is broadly supported, allcreateFactoryusage can be migrated to JSX components. - Breaking
Removed:
react-test-renderer/shallow: This has been a re-export of react-shallow-renderer since React 18. If needed, you can continue to use the third-party package directly. We recommend using @testinglibrary.com/docs/react-testing-library/intro/) or @testingesting-library.com/docs/react-native-testing-library/intro) instead.
Notable Changes
React
<Context>as a provider: You can now render<Context>as a provider instead of<Context.Provider>.Cleanup functions for refs: When the component unmounts, React will call the cleanup function returned from the ref callback.
useDeferredValueinitial value argument: When provided,useDeferredValuewill return the initial value for the initial render of a component, then schedule a re-render in the background with thedeferredValuereturned.Support for Custom Elements: React 19 now passes all tests on Custom Elements Everywhere.
StrictMode changes:
useMemoanduseCallbackwill now reuse the memoized results from the first render, during the second render. Additionally, StrictMode will now double-invoke ref callback functions on initial mount.- Removed
UMD builds removed: To load React 19 with a script tag, we recommend using an ESM-based CDN such as esm.sh.
All Changes
React
Add support for async Actions (#26621, #26726, #28078, #28097, #29226, #29618, #29670, #26716
Add
useActionState()hook to update state based on the result of a Form Action (#27270, #27278, #27309, #27302, #27307, #27366, #27370, #27321, #27374, #27372, #27397, #27399, #27460, #28557, #27570, #27571, #28631, #28788, #29694, #29695, #29694, #29665, #28232, #28319Add
use()API to read resources in render (#25084, #25202, #25207, #25214, #25226, #25247, #25539, #25538, #25537, #25543, #25561, #25620, #25615, #25922, #25641, #25634, #26232, #26536, #26739, #28233Add
useOptimistic()hook to display mutated state optimistically during an async mutation (#26740, #26772, #27277, #27453, #27454, #27936Added an
initialValueargument touseDeferredValue()hook (#27500, #27509, #27512, #27888, #27550Support refs as props, warn on
element.refaccess (#28348, #28464, #28731Support Custom Elements (#22184, #26524, #26523, #27511, #24541
Sibling pre-rendering replaced by sibling pre-warming (#26380, #26549, #30761, #30800, #30762, #30879, #30934, #30952, #31056, #31452
Batch sync discrete, continuous, and default lanes (#25700
Switch
<Context>to mean<Context.Provider>(#28226Changes to StrictMode
Handle
info,group, andgroupCollapsedin StrictMode logging (#25172Refs are now attached/detached/attached in StrictMode (#25049
Fix
useSyncExternalStore()hydration in StrictMode (#26791Always trigger
componentWillUnmount()in StrictMode (#26842Restore double invoking
useState()anduseReducer()initializer functions in StrictMode (#28248Reuse memoized result from first pass (#25583
Fix
useId()in StrictMode (#25713Add component name to StrictMode error messages (#25718
Add support for rendering BigInt (#24580
act()no longer checksshouldYieldwhich can be inaccurate in test environments (#26317Generate sourcemaps for production build artifacts (#26446
Improve stack diffing algorithm (#27132
Suspense throttling lowered from 500ms to 300ms (#26803
Lazily propagate context changes (#20890
Immediately rerender pinged fiber (#25074
Move update scheduling to microtask (#26512
Suspend Thenable/Lazy if it's used in React.Children (#28284
Detect infinite update loops caused by render phase updates (#26625
Update conditional hooks warning (#29626
Update error URLs to go to new docs (#27240
Rename the
react.elementsymbol toreact.transitional.element(#28813Fix crash when suspending in shell during
useSyncExternalStore()re-render (#27199Fix incorrect “detected multiple renderers" error in tests (#22797
Fix bug where effect cleanup may be called twice after bailout (#26561
Fix suspending in shell during discrete update (#25495
Fix memory leak after repeated setState bailouts (#25309
Fix
useSyncExternalStore()dropped update when state is dispatched in render phase (#25578Fix logging when rendering a lazy fragment (#30372
- Removed
Remove Legacy Context (#30319
Remove
RefreshRuntime.findAffectedHostInstances(#30538- Removed
Remove
defaultPropssupport, except for classes (#28733- Removed
Remove UMD builds (#28735
Remove delay for non-transition updates (#26597
Remove
createFactory(#27798
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.