react-test-renderer
19.3.1 · 14 Oct 2026MIT12.8M / weekRepositoryHomepagenpmAtom feed
91 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 19.x · latest line
19.3.1
14 Oct 2026Improve transport protocol
19.3.0
9 Sep 2026<ViewTransition />: Adds<ViewTransition />andaddTransitionTypeAPIs to power View Transition animations in React (@sebmarkbage, @jackpope, @gaearon: #31975, #31987, #31996, #31999, #32001, #32002, #32028, #32029, #32031, #32034, #32038, #32041, #32050, #32090, #32105, #32254, #32379, #32422, #32462, #32540, #32545, #32585, #32599, #32611, #32612, #32617, #32651, #32653, #32656, #32664, #32699, #32723, #32734, #32751, #32752, #32760, #32761, #32764, #32772, #32790, #32819, #32820, #32822, #32833, #32849, #33094, #33191, #33200, #33206, #33293, #33330, #33331, #33332, #33357, #33362, #33433, #33576, #34374, #34450, #34481, #34500, #34502, #34510, #34511, #34539, #35567, #35564, #35485, #35380, #35063, #35060, #34676, #36917, #35337, #35520)Fragment Refs: Add Refs to
<Fragment />to support composable platform behavior (@jackpope, @sebmarkbage, @eps1lon, @Dhakshin2007, @chirokas, @teamleaderleo, @fallintoplace: #32465, #32613, #32619, #32654, #32660, #32682, #32722, #32813, #32814, #33056, #33058, #33093, #34069, #34103, #34544, #34545, #37062, #37061, #37060, #36047, #36010, #35642, #35641, #35637, #35630, #34935, #37457, #37408, #37326, #37251, #37171, #37169, #37168, #37167, #37166, #37165, #37164, #37163, #37162, #37161, #37160, #37125, #37063)
Below is a list of all new features, APIs, and bug fixes.
Read the React 19.3 release post for more information.
New React Features
<ViewTransition />: Adds<ViewTransition />andaddTransitionTypeAPIs to power View Transition animations in React (@sebmarkbage, @jackpope, @gaearon: #31975, #31987, #31996, #31999, #32001, #32002, #32028, #32029, #32031, #32034, #32038, #32041, #32050, #32090, #32105, #32254, #32379, #32422, #32462, #32540, #32545, #32585, #32599, #32611, #32612, #32617, #32651, #32653, #32656, #32664, #32699, #32723, #32734, #32751, #32752, #32760, #32761, #32764, #32772, #32790, #32819, #32820, #32822, #32833, #32849, #33094, #33191, #33200, #33206, #33293, #33330, #33331, #33332, #33357, #33362, #33433, #33576, #34374, #34450, #34481, #34500, #34502, #34510, #34511, #34539, #35567, #35564, #35485, #35380, #35063, #35060, #34676, #36917, #35337, #35520)Fragment Refs: Add Refs to
<Fragment />to support composable platform behavior (@jackpope, @sebmarkbage, @eps1lon, @Dhakshin2007, @chirokas, @teamleaderleo, @fallintoplace: #32465, #32613, #32619, #32654, #32660, #32682, #32722, #32813, #32814, #33056, #33058, #33093, #34069, #34103, #34544, #34545, #37062, #37061, #37060, #36047, #36010, #35642, #35641, #35637, #35630, #34935, #37457, #37408, #37326, #37251, #37171, #37169, #37168, #37167, #37166, #37165, #37164, #37163, #37162, #37161, #37160, #37125, #37063)
New React DOM Features
browser(): a newreact-domAPI that returns a usable which errors during server rendering and resolves in the browser.use(browser())inside a<Suspense>boundary marks a subtree as browser-only without reporting a recoverable error (@gnoff: #37143, #37241)
Notable changes
Enable Trusted Types API integration (@rickhanlonii #35816)
Transitions now render independently instead of being entangled into a single render, so a slow transition no longer holds up unrelated ones (@acdlite #37290)
Added a DEV-only warning when a component appears to have been unblocked by calling
use()conditionally (@hoxyq, @eps1lon: #37104, #37203, #37491)
All Changes
React
Fast Refresh Fixes
Fix Fast Refresh to find and remount edits to components wrapped behind
lazy()(@sophiebits #36965)Fix Fast Refresh so edits to a
memo()comparison function take effect (@sophiebits #36964)Fix Fast Refresh crash when an edit changes the kind of a component's type (@sophiebits #36963)
Unify hot reload type resolution for Fast Refresh (@sophiebits #36962)
Fix Fast Refresh to remount correctly when an edit changes the component kind (@sophiebits #36950)
Double invoke effects in StrictMode after Fast Refresh (@eps1lon #35962)
Performance Track Fixes
Prevent crash when accessing
$$typeofin Performance Tracks (@eps1lon #35679)Handle non-string function names in Performance Tracks (@eps1lon #35659)
Use minus (
-) instead of en dash for removed props in Performance Tracks (@eps1lon #35649)Handle arrays with bigints in deep objects in Performance Tracks (@eps1lon #35648)
Don't enumerate typed array props in Performance Tracks in DEV (@UditDewan #36913)
Bail out of diffing wide objects and arrays in Performance Tracks (@eps1lon #34742)
Clear potentially large performance measures in DEV (@hoxyq #34803)
Fix missing else branch for renders with no props change in Performance Tracks (@hoxyq #34837)
Activity Fixes
Fix
useSyncExternalStoremissing store mutations that happened while an Activity tree was hidden (@sophiebits #36947)Hide portal contents when an Activity is hidden (@acdlite #35091)
Prevent metadata hoisting in hidden
<Activity>trees (@ronnakamoto #34983)Prevent errors thrown inside a hidden Activity from escaping to the visible UI (@acdlite #35074)
Don't unhide a node if a direct parent Offscreen is still hidden (@sebmarkbage #34821)
Don't show internal
<Offscreen>component in error messages (@rickhanlonii #35763)
Warn in DEV when a component appears to have been unblocked by a conditional
use()(@hoxyq, @eps1lon: #37104, #37203, #37491)Render transitions independently instead of entangling them into a single render (@acdlite #37290)
Fix hang when updating a dehydrated boundary inside a hidden tree (@gaearon #37135)
Don't reacquire Host Singletons during dev effect validation (@gnoff #37113)
Only remove properties from Host Singletons on release (@gnoff #37112)
Don't invoke effects on moved children in StrictMode (@sophiebits #36948)
Throw a clearer error when a rejected Promise is incorrectly instrumented (@eps1lon #36328)
Fix context propagation into Suspense fallbacks (@acdlite #36160)
Fix context propagation through suspended Suspense boundaries (@acdlite #35839)
Update
useActionStateerror message to say "action state" instead of "form state" (@rickhanlonii #35790)Don't warn when rendering data block scripts (@eps1lon #35953)
Treat fibers with alternates as mounted in
getNearestMountedFiber(@sebmarkbage #35578)Always instrument the lazy initializer thenable (@gnoff #35521)
Annotate cascading updates for DevTools performance tracks in DEV (@huntie #34961)
Resolve the
.defaultexport of aReact.lazyas the canonical value (@sebmarkbage #34906)Ensure
useEffectEventreads latest values inforwardRefandmemo()components (@eps1lon #34831)
React DOM
Copy
sourceonto the synthetictoggleevent (@lazerg #37389)Update HTML parser rules for the new
<select>parser (@josepharhar #34804)Update
defaultValuefortype="number"inputs to match other input types (@sophiebits #36980)Avoid setting
innerHTMLwhen it hasn't changed (@sophiebits #36949)Forward the
nonceoption inReactDOM.preloadModule()(@UditDewan #36851)Support
fetchPriorityfor module resources (@TheAlexLichter #36835)Track stylesheet preloads when explicitly preloaded to avoid unnecessary suspension (@gnoff #36386)
Suggest correct casing for the misspelled
credentiallessiframe attribute (@vmx906 #36322)Add
credentiallessas a recognized boolean attribute for iframes (@vmx906 #36148)Prevent reentrant
finishedTaskfrom callingcompleteAllmultiple times (@gnoff #36287)Add support for
onFullscreenChangeandonFullscreenErrorevents (@chirokas #34621)Fire
onResetwhen automatically resetting forms (@eps1lon #35176)Fix form status reset when component state is updated (@eps1lon #34075)
Batch updates from
resizeevents until the next frame (@eps1lon #35117)
React Server
Add
nonceto rendered import maps (@mattcosta7 #37339)Add an
onBrowserBailoutoption to observe subtrees that defer to the browser (@gnoff #37193)Stop the caller's signal from retaining a finished render (@unstubbable #37315)
Construct the render lifetime controller only when it is needed (@unstubbable #37357)
Extend stack overflow recovery to retries in SSR (@jackpope #36977)
Fix false-positive hydration mismatch on
nonceattributes (@MaxwellCohen #37030)Guard shell-error callbacks instead of nulling them out on the request (@eps1lon #36916)
Stop firing
onAllReadyafter the shell errored (@eps1lon #36903)Treat an incomplete tree as an error during error recovery (@acdlite #36911)
Fix non-script
modulepreloadtracking (@fallintoplace #36564)Finalize postponed
nextSegmentIdafter the prelude flush (@gaojude #36779)Preserve
referrerPolicyin image preload headers (@ulises-jeremias #36803)Allow pending work to specialize abort reasons (@gnoff #36586)
Abort tasks that suspend after aborting during render (@gnoff #36585)
Model external work scheduling explicitly in the fb bundle (@gnoff #36576)
Continue reporting aborted task errors after a fatal abort (@gnoff #36575)
Fix crash when capturing the callsite of a stalled
use()of a rejected Flight chunk (@lubieowoce #36544)Double invoke effects in Strict Mode during hydration (@eps1lon #35961)
Add additional task reentrancy protections in Fizz (@gnoff #36291)
Don't outline Suspense boundaries with suspensey CSS during shell flush (@gnoff #35824)
Push a stalled
use()to the owner stack and debug task (@eps1lon #35226)Simplify the
createSuspenseBoundarypath (@sebmarkbage #35087)Unify preamble-only fields to save a field on Suspense boundaries (@sebmarkbage #35068)
Unify prerender-only fields to save a field on Suspense boundaries (@sebmarkbage #35067)
Push halted awaits to the owner stack for late-arriving I/O info (@unstubbable #35019)
Include all Node.js APIs in the Bun entrypoint for
react-dom/server(@RiskyMH #34193)Detach a Suspense boundary after flushing its segment (@gnoff #34694)
React Server Components
Keep an element pending while a referenced row is resolving (@unstubbable #37542)
Fix
RangeErrorfrom exponential debug info growth (@unstubbable #37481)Abort the cache signal when debug objects are retained (@unstubbable #37342)
Transfer key validation of lazy nodes when they are unwrapped (@unstubbable #37258)
Add
pending_weakto the Flight thenable protocol (@acdlite #37154)Port Reply Server traversal guards to the Flight Client (@eps1lon #37144)
Define Flight chunk
.thenwithObject.defineProperty(@eps1lon #37109)Support Turbopack's experimental array format for chunks (@sampoder #37095)
Limit fake JSX call site stacks to 10 frames (@timneutkens #37086)
Improve performance when decoding Flight replies (@gnoff #37090)
Recognize Node 22+ V8 frames for
Promisestatics in debug info (@gaearon #36969)Tailor the warning for binary data serialized through
toJSON(NodeBuffer) (@unstubbable #36873)Resolve models before
JSON.stringifyfor faster serialization (@mhart #36795)Avoid main-thread stalls from large debug strings (@unstubbable #36570)
Fix stranded row content under Node stream backpressure (@unstubbable #36516)
Fix dropped
FormDataentries indecodeReplyFromBusboy(@unstubbable #36468)Harden types and improve performance of Flight replies (@eps1lon #36425)
Add more cycle protections to Flight replies (@eps1lon #36236)
Bail out early when a backing entry for
Blobdeserialization is not aBlob(@eps1lon #36055)Clear chunk reason after successful module initialization (@unstubbable #36024)
Walk parsed JSON instead of using a reviver for faster RSC payload parsing (@timneutkens #35776)
Skip
transferReferencedDebugInfoduring debug info resolution (@unstubbable #35795)Add
unstable_allowPartialStreamoption to Flight Client (@unstubbable #35731)Fix
encodeReplyfor JSX with temporary references (@unstubbable #35730)Fix debug channel flag in Node.js
renderToPipeableStream(@feedthejim #35724)Fix stack overflow in
visitAsyncNodewith deep async chains (@unstubbable #35612)Allow Server Components to render context providers from client modules (@rickhanlonii #35675)
Allow overriding
request.timeOriginviaoptions.startTime(@lubieowoce #35598)Warn once if
evalis disabled in the dev environment (@eps1lon #35661)Restore original function name in dev server callstacks served with
unsafe-eval(@eps1lon #35650)Fix
react-markuptypes for server references (@eps1lon #35634)Add more DoS mitigations to Flight replies and harden Flight (@unstubbable #35632)
Allow cyclic references to be serialized when unwrapping lazy elements (@unstubbable #35471)
Improve cyclic thenable detection in Flight reply server (@cvan20191 #35369)
Add extra loop protection to Flight reply server (@sebmarkbage #35351)
Patch Promise cycles and
toStringon Server Functions (@sebmarkbage #35345)Move
react-server-dom-webpack/*.unbundledto privatereact-server-dom-unbundled(@eps1lon #35290)Never parse
thenfunctions in Flight replies (@sebmarkbage #35289)Patch Flight reply server with fixes from Flight Client (@sebmarkbage #35277)
Complete the list of Node.js internal Promise awaits (@eps1lon #35161)
Reduce risk of maximum call stack exceeded when emitting async sequences (@eps1lon #35159)
Fix pending chunks count for streams and async iterables in DEV (@unstubbable #35143)
Fix broken byte stream parsing caused by buffer detachment (@unstubbable #35127)
Fix
hasReadableflag in Node.js clients' debug channel (@unstubbable #35039)Fix debug info filtering to include later resolved I/O (@unstubbable #35036)
Cache the value when visiting the same I/O or Promise along different paths (@sebmarkbage #35005)
Clone subsequent I/O nodes when resolved more than once (@sebmarkbage #35003)
Fix hang after resolving cyclic references (@unstubbable #34988)
Allow passing DEV-only
startTimeas an option (@sebmarkbage #34912)Ignore bound-anonymous-fn resources as they're not considered I/O (@sebmarkbage #34911)
Fix detached
ArrayBuffererror when streaming typed arrays (@unstubbable #34849)Exclude RSC stream if the stream resolves in a task (@sebmarkbage #34838)
Forward the current environment when forwarding I/O entries (@sebmarkbage #34836)
Look for moved debug info when logging component performance track (@sebmarkbage #34839)
Respect
displayNameof Promise instances on the server (@sebmarkbage #34825)Avoid unnecessary indirection when serializing debug info (@unstubbable #34797)
Fix preload
asattribute for stylesheets (@unstubbable #34760)Don't serialize
toJSONin debug path and omit wide arrays (@sebmarkbage #34759)
19.2.9
14 Oct 2026Improve transport protocol
19.2.8
21 Jul 2026Performance improvements when decoding
19.2.7
1 Jun 2026Fixed missing
FormDataentries in Server Actions which regressed in 19.2.6
19.2.6
6 May 2026Type hardening and performance improvements
19.2.5
8 Apr 2026Add more cycle protections
19.2.4
26 Jan 2026Add more DoS mitigations to Server Actions, and harden Server Components
19.2.3
11 Dec 2025Add extra loop protection to React Server Functions (@sebmarkbage #35351)
19.2.2
11 Dec 2025Patch Promise cycles and toString on Server Functions (@sebmarkbage, @unstubbable #35289, #35345)
19.2.1
3 Dec 2025Bring React Server Component fixes to Server Actions (@sebmarkbage #35277)
19.2.0
1 Oct 2025<Activity>: A new API to hide and restore the UI and internal state of its children.useEffectEventis a React Hook that lets you extract non-reactive logic into an Effect Event.cacheSignal(for RSCs) lets your know when thecache()lifetime is over.
Below is a list of all new features, APIs, and bug fixes.
Read the React 19.2 release post for more information.
New React Features
<Activity>: A new API to hide and restore the UI and internal state of its children.useEffectEventis a React Hook that lets you extract non-reactive logic into an Effect Event.cacheSignal(for RSCs) lets your know when thecache()lifetime is over.React Performance tracks appear on the Performance panel’s timeline in your browser developer tools
New React DOM Features
Added resume APIs for partial pre-rendering with Web Streams:
resume: to resume a prerender to a stream.resumeAndPrerender: to resume a prerender to HTML.
Added resume APIs for partial pre-rendering with Node Streams:
resumeToPipeableStream: to resume a prerender to a stream.resumeAndPrerenderToNodeStream: to resume a prerender to HTML.
Updated
prerenderAPIs to return apostponedstate that can be passed to theresumeAPIs.
Notable changes
React DOM now batches suspense boundary reveals, matching the behavior of client side rendering. This change is especially noticeable when animating the reveal of Suspense boundaries e.g. with the upcoming
<ViewTransition>Component. React will batch as much reveals as possible before the first paint while trying to hit popular first-contentful paint metrics.Add Node Web Streams (
prerender,renderToReadableStream) to server-side-rendering APIs for Node.jsUse underscore instead of
:IDs generated by useId
All Changes
React
<Activity />was developed over many years, starting beforeClassComponent.setState(@acdlite @sebmarkbage and many others)Stringify context as "SomeContext" instead of "SomeContext.Provider" (@kassens #33507)
Include stack of cause of React instrumentation errors with
%oplaceholder (@eps1lon #34198)Fix infinite
useDeferredValueloop in popstate event (@acdlite #32821)Fix a bug when an initial value was passed to
useDeferredValue(@acdlite #34376)Fix a crash when submitting forms with Client Actions (@sebmarkbage #33055)
Hide/unhide the content of dehydrated suspense boundaries if they resuspend (@sebmarkbage #32900)
Avoid stack overflow on wide trees during Hot Reload (@sophiebits #34145)
Improve Owner and Component stacks in various places (@sebmarkbage, @eps1lon: #33629, #33724, #32735, #33723)
Add
cacheSignal(@sebmarkbage #33557)
React DOM
Block on Suspensey Fonts during reveal of server-side-rendered content (@sebmarkbage #33342)
Use underscore instead of
:for IDs generated byuseId(@sebmarkbage, @eps1lon: #32001, #33342#33099, #33422)Stop warning when ARIA 1.3 attributes are used (@Abdul-Omira #34264)
Allow
nonceto be used on hoistable styles (@Andarist #32461)Warn for using a React owned node as a Container if it also has text content (@sebmarkbage #32774)
s/HTML/text for for error messages if text hydration mismatches (@rickhanlonii #32763)
Fix a bug with
React.useinsideReact.lazy-ed Component (@hi-ogawa #33941)Enable the
progressiveChunkSizeoption for server-side-rendering APIs (@sebmarkbage #33027)Fix a bug with deeply nested Suspense inside Suspense fallback when server-side-rendering (@gnoff #33467)
Avoid hanging when suspending after aborting while rendering (@gnoff #34192)
Add Node Web Streams to server-side-rendering APIs for Node.js (@sebmarkbage #33475)
React Server Components
Preload
<img>and<link>using hints before they're rendered (@sebmarkbage #34604)Log error if production elements are rendered during development (@eps1lon #34189)
Fix a bug when returning a Temporary reference (e.g. a Client Reference) from Server Functions (@sebmarkbage #34084, @denk0403 #33761)
Support Async Modules in Turbopack Server References (@lubieowoce #34531)
Add support for .mjs file extension in Webpack (@jennyscript #33028)
Fix a wrong missing key warning (@unstubbable #34350)
Make console log resolve in predictable order (@sebmarkbage #33665)
React Reconciler
createContainer and createHydrationContainer had their parameter order adjusted after
on*handlers to account for upcoming experimental APIs
19.1.10
14 Oct 2026Improve transport protocol
19.1.9
21 Jul 2026Performance improvements when decoding
19.1.8
1 Jun 2026Fixed missing
FormDataentries in Server Actions which regressed in 19.1.7
19.1.7
6 May 2026Type hardening and performance improvements
19.1.6
8 Apr 2026Add more cycle protections
19.1.5
26 Jan 2026Add more DoS mitigations to Server Actions, and harden Server Components
19.1.4
11 Dec 2025Add extra loop protection to React Server Functions (@sebmarkbage #35351)
19.1.3
11 Dec 2025Patch Promise cycles and toString on Server Functions (@sebmarkbage, @unstubbable #35289, #35345)
19.1.2
3 Dec 2025Bring React Server Component fixes to Server Actions (@sebmarkbage #35277)
19.1.1
28 Jul 2025Fixed Owner Stacks to work with ES2015 function.name semantics
19.1.0
28 Mar 2025- Removed
Removed support for using HTML comments (e.g.
<!-- -->) as a DOM container. #32250 An Owner Stack is a development-only stack trace that helps identify which components are responsible for rendering a particular component. An Owner Stack is distinct from a Component Stacks, which shows the hierarchy of components leading to an error.
Owner Stack
An Owner Stack is a string representing the components that are directly responsible for rendering a particular component. You can log Owner Stacks when debugging or use Owner Stacks to enhance error overlays or other development tools. Owner Stacks are only available in development builds. Component Stacks in production are unchanged.
An Owner Stack is a development-only stack trace that helps identify which components are responsible for rendering a particular component. An Owner Stack is distinct from a Component Stacks, which shows the hierarchy of components leading to an error.
The captureOwnerStack API is only available in development mode and returns a Owner Stack, if available. The API can be used to enhance error overlays or log component relationships when debugging. #29923, #32353, #30306,
#32538, #32529, #32538
React
Enhanced support for Suspense boundaries to be used anywhere, including the client, server, and during hydration. #32069, #32163, #32224, #32252
Reduced unnecessary client rendering through improved hydration scheduling #31751
Increased priority of client rendered Suspense boundaries #31776
Fixed frozen fallback states by rendering unfinished Suspense boundaries on the client. #31620
Reduced garbage collection pressure by improving Suspense boundary retries. #31667
Fixed erroneous “Waiting for Paint” log when the passive effect phase was not delayed #31526
Fixed a regression causing key warnings for flattened positional children in development mode. #32117
Updated
useIdto use valid CSS selectors, changing format from:r123:to«r123». #32001Added a dev-only warning for null/undefined created in useEffect, useInsertionEffect, and useLayoutEffect. #32355
Fixed a bug where dev-only methods were exported in production builds. React.act is no longer available in production builds. #32200
Improved consistency across prod and dev to improve compatibility with Google Closure Complier and bindings #31808
Improve passive effect scheduling for consistent task yielding. #31785
Fixed asserts in React Native when passChildrenWhenCloningPersistedNodes is enabled for OffscreenComponent rendering. #32528
Fixed component name resolution for Portal #32640
Added support for beforetoggle and toggle events on the dialog element. #32479 #32479
React DOM
Fixed double warning when the
hrefattribute is an empty string #31783Fixed an edge case where
getHoistableRoot()didn’t work properly when the container was a Document #32321- Removed
Removed support for using HTML comments (e.g.
<!-- -->) as a DOM container. #32250 Added support for
<script>and<template>tags to be nested within<select>tags. #31837Fixed responsive images to be preloaded as HTML instead of headers #32445
use-sync-external-store
Added
exportsfield topackage.jsonforuse-sync-external-storeto support various entrypoints. #25231
React Server Components
Added
unstable_prerender, a new experimental API for prerendering React Server Components on the server #31724Fixed an issue where streams would hang when receiving new chunks after a global error #31840, #31851
Fixed an issue where pending chunks were counted twice. #31833
Added support for streaming in edge environments #31852
Added support for sending custom error names from a server so that they are available in the client for console replaying. #32116
Updated the server component wire format to remove IDs for hints and console.log because they have no return value #31671
Exposed
registerServerReferencein client builds to handle server references in different environments. #32534Added react-server-dom-parcel package which integrates Server Components with the Parcel bundler #31725, #32132, #31799, #32294, #31741
19.0.9
14 Oct 2026Improve transport protocol
19.0.8
21 Jul 2026Performance improvements when decoding
19.0.7
1 Jun 2026Fixed missing
FormDataentries in Server Actions which regressed in 19.0.6
19.0.6
6 May 2026Type hardening and performance improvements
19.0.5
8 Apr 2026Add more cycle protections
19.0.4
26 Jan 2026Add more DoS mitigations to Server Actions, and harden Server Components
19.0.3
11 Dec 2025Add extra loop protection to React Server Functions (@sebmarkbage #35351)
19.0.2
11 Dec 2025Patch Promise cycles and toString on Server Functions (@sebmarkbage, @unstubbable #35289, #35345)
19.0.1
3 Dec 2025Bring React Server Component fixes to Server Actions (@sebmarkbage #35277)
19.0.0
5 Dec 2024- Deprecated
Deprecated:
element.refaccess: React 19 supports ref as a prop, so we’re deprecatingelement.refin favor ofelement.props.ref. Accessing will result in a warning. - Deprecated
react-test-renderer: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @testinglibrary.com/docs/react-testing-library/intro/) or @testingesting-library.com/docs/react-native-testing-library/intro) - 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.
Below is a list of all new features, APIs, deprecations, and breaking changes. Read React 19 release post and React 19 upgrade guide for more information.
Note: To help make the upgrade to React 19 easier, we’ve published a react@18.3 release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.
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.
React DOM Client
<form> actionprop: Form Actions allow you to manage forms automatically and integrate withuseFormStatus. When a<form> actionsucceeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the newrequestFormResetAPI.<button> and <input> formActionprop: Actions can be passed to theformActionprop to configure form submission behavior. This allows using different Actions depending on the input.useFormStatus: is a new hook that provides the status of the parent<form> action, as if the form was a Context provider. The hook returns the values:pending,data,method, andaction.Support for Document Metadata: We’ve added support for rendering document metadata tags in components natively. React will automatically hoist them into the
<head>section of the document.Support for Stylesheets: React 19 will ensure stylesheets are inserted into the
<head>on the client before revealing the content of a Suspense boundary that depends on that stylesheet.Support for async scripts: Async scripts can be rendered anywhere in the component tree and React will handle ordering and deduplication.
Support for preloading resources: React 19 ships with
preinit,preload,prefetchDNS, andpreconnectAPIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.
React DOM Server
Added
prerenderandprerenderToNodeStreamAPIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. UnlikerenderToString, they wait for data to load for HTML generation.
React Server Components
RSC features such as directives, server components, and server functions are now stable. This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture. The underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. See docs for how to support React Server Components.
Deprecations
- Deprecated
Deprecated:
element.refaccess: React 19 supports ref as a prop, so we’re deprecatingelement.refin favor ofelement.props.ref. Accessing will result in a warning. - Deprecated
react-test-renderer: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to @testinglibrary.com/docs/react-testing-library/intro/) or @testingesting-library.com/docs/react-native-testing-library/intro)
Breaking Changes
React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to
18.3.1, where we've added additional deprecation warnings. Check out the upgrade guide for more details and guidance on codemodding.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.
React DOM
- Breaking
Removed:
react-dom/test-utils: We’ve movedactfromreact-dom/test-utilsto react. All other utilities have been removed. - Breaking
Removed:
ReactDOM.render,ReactDOM.hydrate: These have been removed in favor of the concurrent equivalents:ReactDOM.createRootandReactDOM.hydrateRoot. - Breaking
Removed:
unmountComponentAtNode: Removed in favor ofroot.unmount(). - Breaking
Removed:
ReactDOM.findDOMNode: You can replaceReactDOM.findDOMNodewith DOM Refs.
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.
React DOM
Diffs for hydration errors: In the case of a mismatch, React 19 logs a single error with a diff of the mismatched content.
Compatibility with third-party scripts and extensions: React will now force a client re-render to fix up any mismatched content caused by elements inserted by third-party JS.
TypeScript Changes
The most common changes can be codemodded with
npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files.- Removed
Removed deprecated TypeScript types:
ReactChild(replacement:React.ReactElement | number | string)ReactFragment(replacement:Iterable<React.ReactNode>)ReactNodeArray(replacement:ReadonlyArray<React.ReactNode>)ReactText(replacement:number | string)VoidFunctionComponent(replacement:FunctionComponent)VFC(replacement:FC)Moved to
prop-types:Requireable,ValidationMap,Validator,WeakValidationMapMoved to
create-react-class:ClassicComponentClass,ClassicComponent,ClassicElement,ComponentSpec,Mixin,ReactChildren,ReactHTML,ReactSVG,SFCFactory
Disallow implicit return in refs: refs can now accept cleanup functions. When you return something else, we can’t tell if you intentionally returned something not meant to clean up or returned the wrong value. Implicit returns of anything but functions will now error.
Require initial argument to
useRef: The initial argument is now required to matchuseState,createContextetcRefs are mutable by default: Ref objects returned from
useRef()are now always mutable instead of sometimes being immutable. This feature was too confusing for users and conflicted with legit cases where refs were managed by React and manually written to.Strict
ReactElementtyping: The props of React elements now default tounknowninstead ofanyif the element is typed asReactElementJSX namespace in TypeScript: The global
JSXnamespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package:import { JSX } from 'react'Better
useReducertypings: MostuseReducerusage should not require explicit type arguments.
For example,-useReducer<React.Reducer<State, Action>>(reducer) +useReducer(reducer)
or
-useReducer<React.Reducer<State, Action>>(reducer) +useReducer<State, [Action]>(reducer)
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
React DOM
Adds Form Actions to handle form submission (#26379, #26674, #26689, #26708, #26714, #26735, #26846, #27358, #28056
Add
useFormStatus()hook to provide status information of the last form submission (#26719, #26722, #26788, #29019, #28728, #28413Support for Document Metadata. Adds
preinit,preinitModule,preconnect,prefetchDNS,preload, andpreloadModuleAPIs.#25060, #25243, #25388, #25432, #25436, #25426, #25500, #25480, #25508, #25515, #25514, #25532, #25536, #25534, #25546, #25559, #25569, #25599, #25689, #26106, #26152, #26239, #26237, #26280, #26154, #26256, #26353, #26427, #26450, #26502, #26514, #26531, #26532, #26557, #26871, #26881, #26877, #26873, #26880, #26942, #26938, #26940, #26939, #27030, #27201, #27212, #27217, #27218, #27220, #27224, #27223, #27269, #27260, #27347, #27346, #27361, #27400, #27541, #27610, #28110, #29693, #29732, #29811, #27586, #28069
Add
fetchPriorityto<img>and<link>(#25927Add support for SVG
transformOriginprop (#26130Add support for
onScrollEndevent (#26789Allow
<hr>as child of<select>(#27632Add support for Popover API (#27981
Add support for
inert(#24730Add support for
imageSizesandimageSrcSet(#22550Synchronously flush transitions in popstate events (#26025, #27559, #27505, #30759
flushSyncexhausts queue even if something throws (#26366Throw error if
reactandreact-domversions don’t match (#29236Ensure
srcsetandsrcare assigned last on<img>instances (#30340Javascript URLs are replaced with functions that throw errors (#26507, #29808
Treat toggle and beforetoggle as discrete events (#29176
Filter out empty
srcandhrefattributes (unless for<a href=”” />) (#18513, #28124Fix unitless
scalestyle property (#25601Fix
onChangeerror message for controlled<select>(#27740Fix focus restore in child windows after element reorder (#30951
Remove
render,hydrate,findDOMNode,unmountComponentAtNode,unstable_createEventHandle,unstable_renderSubtreeIntoContainer, andunstable_runWithPriority. MovecreateRootandhydrateRoottoreact-dom/client. (#28271Remove
test-utils(#28541Remove
unstable_flushControlled(#26397Remove legacy mode (#28468
Remove
renderToStaticNodeStream()(#28873Remove
unstable_renderSubtreeIntoContainer(#29771
React DOM Server
Stable release of React Server Components (Many, many PRs
Changes to SSR
Add external runtime which bootstraps hydration on the client for binary transparency (#25437, #26169, #25499
Support subresource integrity for
bootstrapScriptsandbootstrapModules(#25104Fix null bytes written at text chunk boundaries (#26228
Fix logic around attribute serialization (#26526
Fix precomputed chunk cleared on Node 18 (#25645
Optimize end tag chunks (#27522
Gracefully handle suspending in DOM configs (#26768
Check for nullish values on ReactCustomFormAction (#26770
Preload
bootstrapModules,bootstrapScripts, and update priority queue (#26754, #26753, #27190, #27189Client render the nearest child or parent suspense boundary if replay errors or is aborted (#27386
Don't bail out of flushing if we still have pending root tasks (#27385
Ensure Resumable State is Serializable (#27388
Remove extra render pass when reverting to client render (#26445
Fix unwinding context during selective hydration (#25876
Stop flowing and then abort if a stream is cancelled (#27405
Pass cancellation reason to abort (#27536
Escape
<style>and<script>textContent to enable rendering inner content without dangerouslySetInnerHTML (#28870, #28871Fallback to client replaying actions for Blob serialization (#28987
Render Suspense fallback if boundary contains new stylesheet during sync update (#28965
Fix header length tracking (#30327
Use
srcsetto trigger load event on mount (#30351Don't perform work when closing stream (#30497
Allow aborting during render (#30488, #30730
Start initial work immediately (#31079
A transition flowing into a dehydrated boundary no longer suspends when showing fallback (#27230
Fix selective hydration triggers false update loop error (#27439
Warn for Child Iterator of all types but allow Generator Components (#28853
Include regular stack trace in serialized errors (#28684, #28738
Aborting early no longer infinitely suspends (#24751
Fix hydration warning suppression in text comparisons (#24784
Changes to error handling in SSR
Add Bun streaming server renderer (#25597
Add nonce support to bootstrap scripts (#26738
Add
crossoriginsupport to bootstrap scripts (#26844Support
nonceandfetchpriorityin preload links (#26826Add
referrerPolicytoReactDOM.preload()(#27096Add server condition for
react/jsx-dev-runtime(#28921Export version (#29596
Rename the secret export of Client and Server internals (#28786, #28789
Remove layout effect warning on server (#26395
Remove
errorInfo.digestfromonRecoverableError(#28222
ReactTestRenderer
Add deprecation error to
react-test-rendereron web (#27903, #28904Render with ConcurrentRoot on web (#28498
React Reconciler
React-Is
useSyncExternalStore
- 18.x
18.3.0
25 Apr 2024- Deprecated
Warn for deprecated
findDOMNodeoutside StrictMode c3b283 - Deprecated
Warn for deprecated
test-utilsmethods d4ea75 - Deprecated
Warn for deprecated Legacy Context outside StrictMode 415ee0
This release is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19.
Read the React 19 Upgrade Guide for more info.
React
Allow writing to
this.refsto support string ref codemod 909071- Deprecated
Warn for deprecated
findDOMNodeoutside StrictMode c3b283 - Deprecated
Warn for deprecated
test-utilsmethods d4ea75 - Deprecated
Warn for deprecated Legacy Context outside StrictMode 415ee0
- Deprecated
Warn for deprecated string refs outside StrictMode #25383
- Deprecated
Warn for deprecated
defaultPropsfor function components #25699 Warn when spreading
key#25697Warn when using
actfromtest-utilsd4ea75
React DOM
18.2.0
14 Jun 2022React DOM
Provide a component stack as a second argument to
onRecoverableError. (@gnoff in #24591)Fix hydrating into
documentcausing a blank page on mismatch. (@gnoff in #24523)Fix false positive hydration errors with Suspense. (@gnoff in #24480 and @acdlite in #24532)
Fix ignored
setStatein Safari when adding an iframe. (@gaearon in #24459)
React DOM Server
Pass information about server errors to the client. (@salazarm and @gnoff in #24551 and #24591)
Allow to provide a reason when aborting the HTML stream. (@gnoff in #24680)
Eliminate extraneous text separators in the HTML where possible. (@gnoff in #24630)
Disallow complex children inside
<title>elements to match the browser constraints. (@gnoff in #24679)Fix buffering in some worker environments by explicitly setting
highWaterMarkto0. (@jplhomer in #24641)
Server Components (Experimental)
Add support for
useId()inside Server Components. (@gnoff)
18.1.0
26 Apr 2022Fix the false positive warning about
react-dom/clientwhen using UMD bundle. (@alireza-molaee in #24274)
React DOM
Fix the false positive warning about
react-dom/clientwhen using UMD bundle. (@alireza-molaee in #24274)Fix
suppressHydrationWarningto work in production too. (@gaearon in #24271)Fix
componentWillUnmountfiring twice inside of Suspense. (@acdlite in #24308)Fix some transition updates being ignored. (@acdlite in #24353)
Fix
useDeferredValuecausing an infinite loop when passed an unmemoized value. (@acdlite in #24247)Fix throttling of revealing Suspense fallbacks. (@sunderls in #24253)
Fix an inconsistency in whether the props object is the same between renders. (@Andarist and @acdlite in #24421)
Fix a missing warning about a
setStateloop inuseEffect. (@gaearon in #24298)Warn when calling
setStateinuseInsertionEffect. (@gaearon in #24295)Ensure the reason for hydration errors is always displayed. (@gaearon in #24276)
React DOM Server
Fix escaping for the
bootstrapScriptContentcontents. (@gnoff in #24385)Significantly improve performance of
renderToPipeableStream. (@gnoff in #24291)
ESLint Plugin: React Hooks
Fix false positive errors with a large number of branches. (@scyron6 in #24287)
Don't consider a known dependency stable when the variable is reassigned. (@afzalsayed96 in #24343)
Use Subscription
18.0.0
29 Mar 2022- Deprecated
react-dom:ReactDOM.renderhas been deprecated. Using it will warn and run your app in React 17 mode. - Deprecated
react-dom:ReactDOM.hydratehas been deprecated. Using it will warn and run your app in React 17 mode. - Deprecated
react-dom:ReactDOM.unmountComponentAtNodehas been deprecated.
Below is a list of all new features, APIs, deprecations, and breaking changes.
Read React 18 release post and React 18 upgrade guide for more information.React
useIdis a new hook for generating unique IDs on both the client and server, while avoiding hydration mismatches. It is primarily useful for component libraries integrating with accessibility APIs that require unique IDs. This solves an issue that already exists in React 17 and below, but it’s even more important in React 18 because of how the new streaming server renderer delivers HTML out-of-order.startTransitionanduseTransitionlet you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results).useDeferredValuelets you defer re-rendering a non-urgent part of the tree. It is similar to debouncing, but has a few advantages compared to it. There is no fixed time delay, so React will attempt the deferred render right after the first render is reflected on the screen. The deferred render is interruptible and doesn't block user input.useSyncExternalStoreis a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. It removes the need foruseEffectwhen implementing subscriptions to external data sources, and is recommended for any library that integrates with state external to React.useInsertionEffectis a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you’ve already built a CSS-in-JS library we don’t expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout.
React DOM Client
These new APIs are now exported from
react-dom/client:createRoot: New method to create a root torenderorunmount. Use it instead ofReactDOM.render. New features in React 18 don't work without it.hydrateRoot: New method to hydrate a server rendered application. Use it instead ofReactDOM.hydratein conjunction with the new React DOM Server APIs. New features in React 18 don't work without it.
Both
createRootandhydrateRootaccept a new option calledonRecoverableErrorin case you want to be notified when React recovers from errors during rendering or hydration for logging. By default, React will usereportError, orconsole.errorin the older browsers.React DOM Server
These new APIs are now exported from
react-dom/serverand have full support for streaming Suspense on the server:renderToPipeableStream: for streaming in Node environments.renderToReadableStream: for modern edge runtime environments, such as Deno and Cloudflare workers.
The existing
renderToStringmethod keeps working but is discouraged.Deprecations
- Deprecated
react-dom:ReactDOM.renderhas been deprecated. Using it will warn and run your app in React 17 mode. - Deprecated
react-dom:ReactDOM.hydratehas been deprecated. Using it will warn and run your app in React 17 mode. - Deprecated
react-dom:ReactDOM.unmountComponentAtNodehas been deprecated. - Deprecated
react-dom:ReactDOM.renderSubtreeIntoContainerhas been deprecated. - Deprecated
react-dom/server:ReactDOMServer.renderToNodeStreamhas been deprecated.
Breaking Changes
React
- Breaking
Automatic batching: This release introduces a performance improvement that changes to the way React batches updates to do more batching automatically. See Automatic batching for fewer renders in React 18 for more info. In the rare case that you need to opt out, wrap the state update in
flushSync. - Breaking
Stricter Strict Mode: In the future, React will provide a feature that lets components preserve state between unmounts. To prepare for it, React 18 introduces a new development-only check to Strict Mode. React will automatically unmount and remount every component, whenever a component mounts for the first time, restoring the previous state on the second mount. If this breaks your app, consider removing Strict Mode until you can fix the components to be resilient to remounting with existing state.
- Breaking
Consistent useEffect timing: React now always synchronously flushes effect functions if the update was triggered during a discrete user input event such as a click or a keydown event. Previously, the behavior wasn't always predictable or consistent.
- Breaking
Stricter hydration errors: Hydration mismatches due to missing or extra text content are now treated like errors instead of warnings. React will no longer attempt to "patch up" individual nodes by inserting or deleting a node on the client in an attempt to match the server markup, and will revert to client rendering up to the closest
<Suspense>boundary in the tree. This ensures the hydrated tree is consistent and avoids potential privacy and security holes that can be caused by hydration mismatches. - Breaking
Suspense trees are always consistent: If a component suspends before it's fully added to the tree, React will not add it to the tree in an incomplete state or fire its effects. Instead, React will throw away the new tree completely, wait for the asynchronous operation to finish, and then retry rendering again from scratch. React will render the retry attempt concurrently, and without blocking the browser.
- Breaking
Layout Effects with Suspense: When a tree re-suspends and reverts to a fallback, React will now clean up layout effects, and then re-create them when the content inside the boundary is shown again. This fixes an issue which prevented component libraries from correctly measuring layout when used with Suspense.
- Breaking
New JS Environment Requirements: React now depends on modern browsers features including
Promise,Symbol, andObject.assign. If you support older browsers and devices such as Internet Explorer which do not provide modern browser features natively or have non-compliant implementations, consider including a global polyfill in your bundled application.
Scheduler (Experimental)
- Breaking
Remove unstable
scheduler/tracingAPI
Notable Changes
React
Components can now render
undefined: React no longer throws if you returnundefinedfrom a component. This makes the allowed component return values consistent with values that are allowed in the middle of a component tree. We suggest to use a linter to prevent mistakes like forgetting areturnstatement before JSX.No warning about
setStateon unmounted components: Previously, React warned about memory leaks when you callsetStateon an unmounted component. This warning was added for subscriptions, but people primarily run into it in scenarios where setting state is fine, and workarounds make the code worse. We've removed this warning.No suppression of console logs: When you use Strict Mode, React renders each component twice to help you find unexpected side effects. In React 17, we've suppressed console logs for one of the two renders to make the logs easier to read. In response to community feedback about this being confusing, we've removed the suppression. Instead, if you have React DevTools installed, the second log's renders will be displayed in grey, and there will be an option (off by default) to suppress them completely.
Improved memory usage: React now cleans up more internal fields on unmount, making the impact from unfixed memory leaks that may exist in your application code less severe.
React DOM Server
renderToString: Will no longer error when suspending on the server. Instead, it will emit the fallback HTML for the closest<Suspense>boundary and then retry rendering the same content on the client. It is still recommended that you switch to a streaming API likerenderToPipeableStreamorrenderToReadableStreaminstead.renderToStaticMarkup: Will no longer error when suspending on the server. Instead, it will emit the fallback HTML for the closest<Suspense>boundary and retry rendering on the client.
React
Add
useTransitionanduseDeferredValueto separate urgent updates from transitions. (#10426, #10715, #15593, #15272, #15578, #15769, #17058, #18796, #19121, #19703, #19719, #19724, #20672, #20976Add
useIdfor generating unique IDs. (#17322, #18576, #22644, #22672, #21260Add
useSyncExternalStoreto help external store libraries integrate with React. (#15022, #18000, #18771, #22211, #22292, #22239, #22347, #23150Add
startTransitionas a version ofuseTransitionwithout pending feedback.Add
useInsertionEffectfor CSS-in-JS libraries.Make Suspense remount layout effects when content reappears. (#19322, #19374, #19523, #20625, #21079
Make
<StrictMode>re-run effects to check for restorable state. (#19523 , #21418Assume Symbols are always available.
Remove
object-assignpolyfill.- Removed
Remove unsupported
unstable_changedBitsAPI. Allow components to render undefined.
Flush
useEffectresulting from discrete events like clicks synchronously.Suspense
fallback={undefined}now behaves the same asnulland isn't ignored.Consider all
lazy()resolving to the same component equivalent.Don't patch console during first render.
Improve memory usage.
Improve messages if string coercion throws (Temporal.*, Symbol, etc.)
Use
setImmediatewhen available overMessageChannel.Fix context failing to propagate inside suspended trees.
Fix
useReducerobserving incorrect props by removing the eager bailout mechanism.Fix
setStatebeing ignored in Safari when appending iframes.Fix a crash when rendering
ZonedDateTimein the tree.Fix a crash when document is set to
nullin tests.Fix
onLoadnot triggering when concurrent features are on.Fix a warning when a selector returns
NaN.Fix the generated license header.
Add
package.jsonas one of the entry points.Allow suspending outside a Suspense boundary.
Log a recoverable error whenever hydration fails.
React DOM
Add
createRootandhydrateRoot. (#10239, #11225, #12117, #13732, #15502, #15532, #17035, #17165, #20669, #20748, #20888, #21072, #21417, #21652, #21687, #23207, #23385 by @acdlite, @bvaughn, @gaearon, @lunaruan, @rickhanlonii, @trueadm, and @sebmarkbage)Add selective hydration. (#14717, #14884, #16725, #16880, #17004, #22416, #22629, #22448, #22856, #23176
Add
aria-descriptionto the list of known ARIA attributes.Add
onResizeevent to video elements.Add
imageSizesandimageSrcSetto known props.Allow non-string
<option>children ifvalueis provided.Fix
aspectRatiostyle not being applied.Warn if
renderSubtreeIntoContaineris called.
React DOM Server
Add the new streaming renderer. (#14144, #20970, #21056, #21255, #21200, #21257, #21276, #22443, #22450, #23247, #24025, #24030
Fix context providers in SSR when handling multiple requests.
Revert to client render on text mismatch.
- Deprecated
Deprecate
renderToNodeStream. Fix a spurious error log in the new server renderer.
Fix a bug in the new server renderer.
Ignore function and symbol values inside custom elements on the server.
React DOM Test Utils
Throw when
actis used in production.Support disabling spurious act warnings with
global.IS_REACT_ACT_ENVIRONMENT.Expand act warning to cover all APIs that might schedule React work.
Make
actbatch updates.Remove warning for dangling passive effects.
React Refresh
Track late-mounted roots in Fast Refresh.
Add
exportsfield topackage.json.
Server Components (Experimental)
Add Server Context support.
Add
lazysupport.Update webpack plugin for webpack 5
Fix a mistake in the Node loader.
Use
globalThisinstead ofwindowfor edge environments.
Scheduler (Experimental)
- Removed
Remove unstable
scheduler/tracingAPI
- 17.x
17.0.2
22 Mar 2021react-test-renderer: unpkg.com/react-test-renderer@17.0.2/umd/
17.0.0
20 Oct 2020Add
react/jsx-runtimeandreact/jsx-dev-runtimefor the new JSX transform. (@lunaruan in #18299)
Today, we are releasing React 17!
Learn more about React 17 and how to update to it on the official React blog.
React
Add
react/jsx-runtimeandreact/jsx-dev-runtimefor the new JSX transform. (@lunaruan in #18299)Build component stacks from native error frames. (@sebmarkbage in #18561)
Allow to specify
displayNameon context for improved stacks. (@eps1lon in #18224)Prevent
'use strict'from leaking in the UMD bundles. (@koba04 in #19614)
React DOM
Delegate events to roots instead of
document. (@trueadm in #18195 and others)Clean up all effects before running any next effects. (@bvaughn in #17947)
Run
useEffectcleanup functions asynchronously. (@bvaughn in #17925)Use browser
focusinandfocusoutforonFocusandonBlur. (@trueadm in #19186)Make all
Captureevents use the browser capture phase. (@trueadm in #19221)Don't emulate bubbling of the
onScrollevent. (@gaearon in #19464)Throw if
forwardReformemocomponent returnsundefined. (@gaearon in #19550)Stop exposing internals that won’t be needed by React Native Web. (@necolas in #18483)
Attach all known event listeners when the root mounts. (@gaearon in #19659)
Disable
consolein the second render pass of DEV mode double render. (@sebmarkbage in #18547)- Deprecated
Deprecate the undocumented and misleading
ReactTestUtils.SimulateNativeAPI. (@gaearon in #13407) Rename private field names used in the internals. (@gaearon in #18377)
Don't call User Timing API in development. (@gaearon in #18417)
Disable console during the repeated render in Strict Mode. (@sebmarkbage in #18547)
In Strict Mode, double-render components without Hooks too. (@eps1lon in #18430)
Allow calling
ReactDOM.flushSyncduring lifecycle methods (but warn). (@sebmarkbage in #18759)Add the
codeproperty to the keyboard event objects. (@bl00mber in #18287)Add the
disableRemotePlaybackproperty forvideoelements. (@tombrowndev in #18619)Add the
enterKeyHintproperty forinputelements. (@eps1lon in #18634)Warn when no
valueis provided to<Context.Provider>. (@charlie1404 in #19054)Warn when
memoorforwardRefcomponents returnundefined. (@bvaughn in #19550)Improve the error message for invalid updates. (@JoviDeCroock in #18316)
Exclude forwardRef and memo from stack frames. (@sebmarkbage in #18559)
Improve the error message when switching between controlled and uncontrolled inputs. (@vcarl in #17070)
Keep
onTouchStart,onTouchMove, andonWheelpassive. (@gaearon in #19654)Fix
setStatehanging in development inside a closed iframe. (@gaearon in #19220)Fix rendering bailout for lazy components with
defaultProps. (@jddxf in #18539)Fix a false positive warning when
dangerouslySetInnerHTMLisundefined. (@eps1lon in #18676)Fix Test Utils with non-standard
requireimplementation. (@just-boris in #18632)Fix
onBeforeInputreporting an incorrectevent.type. (@eps1lon in #19561)Fix
event.relatedTargetreported asundefinedin Firefox. (@claytercek in #19607)Fix "unspecified error" in IE11. (@hemakshis in #19664)
Fix rendering into a shadow root. (@Jack-Works in #15894)
Fix
movementX/Ypolyfill with capture events. (@gaearon in #19672)Use delegation for
onSubmitandonResetevents. (@gaearon in #19333)
React DOM Server
Make
useCallbackbehavior consistent withuseMemofor the server renderer. (@alexmckenley in #18783)Fix state leaking when a function component throws. (@pmaccart in #19212)
React Test Renderer
Improve
findByTypeerror message. (@henryqdineen in #17439)
Concurrent Mode (Experimental)
Revamp the priority batching heuristics. (@acdlite in #18796)
Add the
unstable_prefix before the experimental APIs. (@acdlite in #18825)Remove
unstable_discreteUpdatesandunstable_flushDiscreteUpdates. (@trueadm in #18825)- Removed
Disable
<div hidden />prerendering in favor of a different future API. (@acdlite in #18917)Add
unstable_expectedLoadTimeto Suspense for CPU-bound trees. (@acdlite in #19936)Add an experimental
unstable_useOpaqueIdentifierHook. (@lunaruan in #17322)Add an experimental
unstable_startTransitionAPI. (@rickhanlonii in #19696)Using
actin the test renderer no longer flushes Suspense fallbacks. (@acdlite in #18596)Use global render timeout for CPU Suspense. (@sebmarkbage in #19643)
Clear the existing root content before mounting. (@bvaughn in #18730)
Fix a bug causing dropped updates in a suspended tree. (@acdlite in #18384 and #18457)
Fix a bug causing dropped render phase updates. (@acdlite in #18537)
Fix a bug in SuspenseList. (@sebmarkbage in #18412)
Fix a bug causing Suspense fallback to show too early. (@acdlite in #18411)
Fix a bug with class components inside SuspenseList. (@sebmarkbage in #18448)
Fix a bug with inputs that may cause updates to be dropped. (@jddxf in #18515 and @acdlite in #18535)
Fix a bug causing Suspense fallback to get stuck. (@acdlite in #18663)
Don't cut off the tail of a SuspenseList if hydrating. (@sebmarkbage in #18854)
Fix a bug in
useMutableSourcethat may happen whengetSnapshotchanges. (@bvaughn in #18297)Warn if calling setState outside of render but before commit. (@sebmarkbage in #18838)
Artifacts
react: unpkg.com/react@17.0.1/umd/
react-art: unpkg.com/react-art@17.0.1/umd/
react-dom: unpkg.com/react-dom@17.0.1/umd/
react-is: unpkg.com/react-is@17.0.1/umd/
react-test-renderer: unpkg.com/react-test-renderer@17.0.1/umd/
scheduler: unpkg.com/scheduler@0.20.1/umd/
- 16.x
16.14.0
14 Oct 2020Add support for the new JSX transform. (@lunaruan in #18299)
16.13.1
19 Mar 2020react-test-renderer: unpkg.com/react-test-renderer@16.13.1/umd/
16.13.0
26 Feb 2020React
Warn when a string ref is used in a manner that's not amenable to a future codemod (@lunaruan in #17864)
- Deprecated
React DOM
Warn when changes in
stylemay cause an unexpected collision (@sophiebits in #14181, #18002)Warn when a function component is updated during another component's render phase (@acdlite in #17099)
- Deprecated
Fix
onMouseEnterbeing fired on disabled buttons (@AlfredoGJ in #17675)Call
shouldComponentUpdatetwice when developing inStrictMode(@bvaughn in #17942)Don't call
toString()ofdangerouslySetInnerHTML(@sebmarkbage in #17773)Show component stacks in more warnings (@gaearon in #17922, #17586)
Concurrent Mode (Experimental)
Warn for problematic usages of
ReactDOM.createRoot()(@trueadm in #17937)Remove
ReactDOM.createRoot()callback params and added warnings on usage (@bvaughn in #17916)Don't group Idle/Offscreen work with other work (@sebmarkbage in #17456)
Adjust
SuspenseListCPU bound heuristic (@sebmarkbage in #17455)Fix
isPendingonly being true when transitioning from inside an input event (@acdlite in #17382)Fix
React.memocomponents dropping updates when interrupted by a higher priority update (@acdlite in #18091)Don't warn when suspending at the wrong priority (@gaearon in #17971)
Fix a bug with rebasing updates (@acdlite and @sebmarkbage in #17560, #17510, #17483, #17480)
Artifacts
react: unpkg.com/react@16.13.0/umd/
react-art: unpkg.com/react-art@16.13.0/umd/
react-dom: unpkg.com/react-dom@16.13.0/umd/
react-is: unpkg.com/react-is@16.13.0/umd/
react-test-renderer: unpkg.com/react-test-renderer@16.13.0/umd/
scheduler: unpkg.com/scheduler@0.19.0/umd/
16.12.0
14 Nov 2019React DOM
React Is
Artifacts
• react: unpkg.com/react@16.12.0/umd/
• react-art: unpkg.com/react-art@16.12.0/umd/
• react-dom: unpkg.com/react-dom@16.12.0/umd/
• react-is: unpkg.com/react-is@16.12.0/umd/
• react-test-renderer: unpkg.com/react-test-renderer@16.12.0/umd/
• scheduler: unpkg.com/scheduler@0.18.0/umd/16.11.0
22 Oct 2019Fix
mouseenterhandlers from firing twice inside nested React containers. @yuanoook
React DOM
Fix
mouseenterhandlers from firing twice inside nested React containers. @yuanoook- Removed
Remove
unstable_createRootandunstable_createSyncRootexperimental APIs. (These are available in the Experimental channel ascreateRootandcreateSyncRoot.) (@acdlite in #17088)
Artifacts
• react: unpkg.com/react@16.11.0/umd/
• react-art: unpkg.com/react-art@16.11.0/umd/
• react-dom: unpkg.com/react-dom@16.11.0/umd/
• react-is: unpkg.com/react-is@16.11.0/umd/
• react-test-renderer: unpkg.com/react-test-renderer@16.11.0/umd/
• scheduler: unpkg.com/scheduler@0.17.0/umd/16.10.2
3 Oct 2019React DOM
Fix regression in react-native-web by restoring order of arguments in event plugin extractors (@necolas in #16978)
Artifacts
• react: unpkg.com/react@16.10.2/umd/
• react-art: unpkg.com/react-art@16.10.2/umd/
• react-dom: unpkg.com/react-dom@16.10.2/umd/
• react-is: unpkg.com/react-is@16.10.2/umd/
• react-test-renderer: unpkg.com/react-test-renderer@16.10.2/umd/
• scheduler: unpkg.com/scheduler@0.16.2/umd/16.10.1
28 Sep 2019Fix regression in Next.js apps by allowing Suspense mismatch during hydration to silently proceed (@sebmarkbage in #16943)
16.10.0
27 Sep 2019Fix edge case where a hook update wasn't being memoized. (@sebmarkbage in #16359)
Fix heuristic for determining when to hydrate, so we don't incorrectly hydrate during an update. (@sebmarkbage in #16739)
React DOM
Fix edge case where a hook update wasn't being memoized. (@sebmarkbage in #16359)
Fix heuristic for determining when to hydrate, so we don't incorrectly hydrate during an update. (@sebmarkbage in #16739)
Clear additional fiber fields during unmount to save memory. (@trueadm in #16807)
Fix bug with required text fields in Firefox. (@halvves in #16578)
Prefer
Object.isinstead of inline polyfill, when available. (@ku8ar in #16212)Fix bug when mixing Suspense and error handling. (@acdlite in #16801)
Scheduler (Experimental)
Improve queue performance by switching its internal data structure to a min binary heap. (@acdlite in #16245)
Use
postMessageloop with short intervals instead of attempting to align to frame boundaries withrequestAnimationFrame. (@acdlite in #16214)
useSubscription
Avoid tearing issue when a mutation happens and the previous update is still in progress. (@bvaughn in #16623)
Artifacts
• react: unpkg.com/react@16.10.0/umd/
• react-art: unpkg.com/react-art@16.10.0/umd/
• react-dom: unpkg.com/react-dom@16.10.0/umd/
• react-is: unpkg.com/react-is@16.10.0/umd/
• react-test-renderer: unpkg.com/react-test-renderer@16.10.0/umd/
• scheduler: unpkg.com/scheduler@0.16.0/umd/16.9.0
8 Aug 2019- Deprecated
Deprecate old names for the
UNSAFE_*lifecycle methods. (@bvaughn in #15186 and @threepointone in #16103) - Deprecated
Deprecate
javascript:URLs as a common attack surface. (@sebmarkbage in #15047) - Deprecated
Deprecate uncommon "module pattern" (factory) components. (@sebmarkbage in #15145)
React
Add
<React.Profiler>API for gathering performance measurements programmatically. (@bvaughn in #15172)Remove
unstable_ConcurrentModein favor ofunstable_createRoot. (@acdlite in #15532)
React DOM
- Deprecated
Deprecate old names for the
UNSAFE_*lifecycle methods. (@bvaughn in #15186 and @threepointone in #16103) - Deprecated
Deprecate
javascript:URLs as a common attack surface. (@sebmarkbage in #15047) - Deprecated
Deprecate uncommon "module pattern" (factory) components. (@sebmarkbage in #15145)
Add support for the
disablePictureInPictureattribute on<video>. (@eek in #15334)Add support for
onLoadevent for<embed>. (@cherniavskii in #15614)Add support for editing
useStatestate from DevTools. (@bvaughn in #14906)Add support for toggling Suspense from DevTools. (@gaearon in #15232)
Warn when
setStateis called fromuseEffect, creating a loop. (@gaearon in #15180)Fix a crash inside
findDOMNodefor components wrapped in<Suspense>. (@acdlite in #15312)Fix pending effects from being flushed too late. (@acdlite in #15650)
Fix incorrect argument order in a warning message. (@brickspert in #15345)
Fix hiding Suspense fallback nodes when there is an
!importantstyle. (@acdlite in #15861 and #15882)Slightly improve hydration performance. (@bmeurer in #15998)
React DOM Server
React Test Utilities and Test Renderer
Add
act(async () => ...)for testing asynchronous state updates. (@threepointone in #14853)Add support for nesting
actfrom different renderers. (@threepointone in #16039 and #16042)Warn in Strict Mode if effects are scheduled outside an
act()call. (@threepointone in #15763 and #16041)Warn when using
actfrom the wrong renderer. (@threepointone in #15756)
Artifacts
• react: unpkg.com/react@16.9.0/umd/
• react-art: unpkg.com/react-art@16.9.0/umd/
• react-dom: unpkg.com/react-dom@16.9.0/umd/
• react-is: unpkg.com/react-is@16.9.0/umd/
• react-test-renderer: unpkg.com/react-test-renderer@16.9.0/umd/
• scheduler: unpkg.com/scheduler@0.15.0/umd/
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.