react-test-renderer
19.3.1 · 14 Oct 2026MIT12.8M / weekRepositoryHomepagenpmAtom feed
19.3.1 is the newest release of 19.x.
In short
15 breaking13 removed2 deprecated45 new12 fixed59 changed
- Breaking
Below is a list of all new features, APIs, deprecations, and breaking changes.
- Breaking
React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs.
- 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.
Release note
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
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.