This PR contains the following updates:
Release Notes
facebook/react (react)
Compare Source 
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
New React DOM Features
- Added resume APIs for partial pre-rendering with Web Streams:
- Added resume APIs for partial pre-rendering with Node Streams:
- 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.js
- Use underscore instead of :IDs generated by useId
All Changes
React
React DOM
React Server Components
React Reconciler
Compare Source 
React
- Fixed Owner Stacks to work with ES2015 function.name semantics (#33680 by @hoxyq)
Compare Source 
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». #32001
- Added 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 Compiler 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 
React DOM
- Fixed double warning when the hrefattribute is an empty string #31783
- Fixed an edge case where getHoistableRoot()didn’t work properly when the container was a Document #32321
- 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. #31837
- Fixed 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 #31724
- Fixed 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. #32534
- Added react-server-dom-parcel package which integrates Server Components with the Parcel bundler #31725, #32132, #31799, #32294, #31741 
Compare Source 
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 form- actionprop 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 for- forwardRef.
- 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 with- useFormStatus. When a- <form> actionsucceeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new- requestFormResetAPI.
- <button> and <input> formActionprop: Actions can be passed to the- formActionprop 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, and- action.
- 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: element.refaccess: React 19 supports ref as a prop, so we’re deprecatingelement.refin favor ofelement.props.ref. Accessing will result in a warning.
- 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 @testing-library/react or @testing-library/react-native
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
- 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.
- 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.
- Removed: propTypes: UsingpropTypeswill now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
- Removed: defaultPropsfor functions: ES6 default parameters can be used in place. Class components continue to supportdefaultPropssince there is no ES6 alternative.
- Removed: contextTypesandgetChildContext: Legacy Context for class components has been removed in favor of thecontextTypeAPI.
- Removed: string refs: Any usage of string refs need to be migrated to ref callbacks.
- Removed: Module pattern factories: A rarely used pattern that can be migrated to regular functions.
- Removed: React.createFactory: Now that JSX is broadly supported, allcreateFactoryusage can be migrated to JSX components.
- 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 @testing-library/react or @testing-library/react-native instead.
React DOM
- Removed: react-dom/test-utils: We’ve movedactfromreact-dom/test-utilsto react. All other utilities have been removed.
- Removed: ReactDOM.render,ReactDOM.hydrate: These have been removed in favor of the concurrent equivalents:ReactDOM.createRootandReactDOM.hydrateRoot.
- Removed: unmountComponentAtNode: Removed in favor ofroot.unmount().
- 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 the- deferredValuereturned.
- 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.
- 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 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,WeakValidationMap
- Moved 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,createContextetc
- Refs 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 asReactElement
- JSX 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) 
-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 by @acdlite and @sebmarkbage)
- 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, #28319 by @acdlite, @eps1lon, and @rickhanlonii)
- Add 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, #28233 by @acdlite, @MofeiZ, @sebmarkbage, @sophiebits, @eps1lon, and @hansottowirtz)
- Add useOptimistic()hook to display mutated state optimistically during an async mutation (#26740, #26772, #27277, #27453, #27454, #27936 by @acdlite)
- Added an initialValueargument touseDeferredValue()hook (#27500, #27509, #27512, #27888, #27550 by @acdlite)
- Support refs as props, warn on element.refaccess (#28348, #28464, #28731 by @acdlite)
- Support Custom Elements (#22184, #26524, #26523, #27511, #24541 by @josepharhar, @sebmarkbage, @gnoff and @eps1lon)
- Add ref cleanup function (#25686, #28883, #28910 by @sammy-SC, @jackpope, and @kassens)
- Sibling pre-rendering replaced by sibling pre-warming (#26380, #26549, #30761, #30800, #30762, #30879, #30934, #30952, #31056, #31452 by @sammy-SC, @acdlite, @gnoff, @jackpope, @rickhanlonii)
- Don’t rethrow errors at the root (#28627, #28641 by @sebmarkbage)
- Batch sync discrete, continuous, and default lanes (#25700 by @tyao1)
- Switch <Context>to mean<Context.Provider>(#28226 by @gaearon)
- Changes to StrictMode
- Add support for rendering BigInt (#24580 by @eps1lon)
- act()no longer checks- shouldYieldwhich can be inaccurate in test environments (#26317 by @acdlite)
- Warn when keys are spread with props (#25697, #26080 by @sebmarkbage and @kassens)
- Generate sourcemaps for production build artifacts (#26446 by @markerikson)
- Improve stack diffing algorithm (#27132 by @KarimP)
- Suspense throttling lowered from 500ms to 300ms (#26803 by @acdlite)
- Lazily propagate context changes (#20890 by @acdlite and @gnoff)
- Immediately rerender pinged fiber (#25074 by @acdlite)
- Move update scheduling to microtask (#26512 by @acdlite)
- Consistently apply throttled retries (#26611, #26802 by @acdlite)
- Suspend Thenable/Lazy if it's used in React.Children (#28284 by @sebmarkbage)
- Detect infinite update loops caused by render phase updates (#26625 by @acdlite)
- Update conditional hooks warning (#29626 by @sophiebits)
- Update error URLs to go to new docs (#27240 by @rickhanlonii)
- Rename the react.elementsymbol toreact.transitional.element(#28813 by @sebmarkbage)
- Fix crash when suspending in shell during useSyncExternalStore()re-render (#27199 by @acdlite)
- Fix incorrect "detected multiple renderers" error in tests (#22797 by @eps1lon)
- Fix bug where effect cleanup may be called twice after bailout (#26561 by @acdlite)
- Fix suspending in shell during discrete update (#25495 by @acdlite)
- Fix memory leak after repeated setState bailouts (#25309 by @acdlite)
- Fix useSyncExternalStore()dropped update when state is dispatched in render phase (#25578 by @pandaiolo)
- Fix logging when rendering a lazy fragment (#30372 by @tom-sherman)
- Remove string refs (#25383, #28322 by @eps1lon and @acdlite)
- Remove Legacy Context (#30319 by @kassens)
- Remove RefreshRuntime.findAffectedHostInstances(#30538 by @gaearon)
- Remove client caching from cache()API (#27977, #28250 by @acdlite and @gnoff)
- Remove propTypes(#28324, #28326 by @gaearon)
- Remove defaultPropssupport, except for classes (#28733 by @acdlite)
- Remove UMD builds (#28735 by @gnoff)
- Remove delay for non-transition updates (#26597 by @acdlite)
- Remove createFactory(#27798 by @kassens)
React DOM
- Adds Form Actions to handle form submission (#26379, #26674, #26689, #26708, #26714, #26735, #26846, #27358, #28056 by @sebmarkbage, @acdlite, and @jupapios)
- Add useFormStatus()hook to provide status information of the last form submission (#26719, #26722, #26788, #29019, #28728, #28413 by @acdlite and @eps1lon)
- Support 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 by @gnoff, @sebmarkbage, @acdlite, @kassens, @sokra, @sweetliquid 
 
- Add fetchPriorityto<img>and<link>(#25927 by @styfle)
- Add support for SVG transformOriginprop (#26130 by @arav-ind)
- Add support for onScrollEndevent (#26789 by @devongovett)
- Allow <hr>as child of<select>(#27632 by @SouSingh)
- Add support for Popover API (#27981 by @eps1lon)
- Add support for inert(#24730 by @eps1lon)
- Add support for imageSizesandimageSrcSet(#22550 by @eps1lon)
- Synchronously flush transitions in popstate events (#26025, #27559, #27505, #30759 by @tyao1 and @acdlite)
- flushSyncexhausts queue even if something throws (#26366 by @acdlite)
- Throw error if reactandreact-domversions don’t match (#29236 by @acdlite)
- Ensure srcsetandsrcare assigned last on<img>instances (#30340 by @gnoff)
- Javascript URLs are replaced with functions that throw errors (#26507, #29808 by @sebmarkbage and @kassens)
- Treat toggle and beforetoggle as discrete events (#29176 by @eps1lon)
- Filter out empty srcandhrefattributes (unless for<a href="" />) (#18513, #28124 by @bvaughn and @eps1lon)
- Fix unitless scalestyle property (#25601 by @JonnyBurger)
- Fix onChangeerror message for controlled<select>(#27740 by @Biki-das)
- Fix focus restore in child windows after element reorder (#30951 by @ling1726)
- Remove render,hydrate,findDOMNode,unmountComponentAtNode,unstable_createEventHandle,unstable_renderSubtreeIntoContainer, andunstable_runWithPriority. MovecreateRootandhydrateRoottoreact-dom/client. (#28271 by @gnoff)
- Remove test-utils(#28541 by @eps1lon)
- Remove unstable_flushControlled(#26397 by @kassens)
- Remove legacy mode ([#28468](https://redirect.github.com/facebook/re 
 
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.
  
 
Uh oh!
There was an error while loading. Please reload this page.
This PR contains the following updates:
18.3.1->19.2.018.3.1->19.2.0Release Notes
facebook/react (react)
v19.2.0Compare Source
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.New React DOM Features
resume: to resume a prerender to a stream.resumeAndPrerender: to resume a prerender to HTML.resumeToPipeableStream: to resume a prerender to a stream.resumeAndPrerenderToNodeStream: to resume a prerender to HTML.prerenderAPIs to return apostponedstate that can be passed to theresumeAPIs.Notable changes
<ViewTransition>Component. React will batch as much reveals as possible before the first paint while trying to hit popular first-contentful paint metrics.prerender,renderToReadableStream) to server-side-rendering APIs for Node.js:IDs generated by useIdAll Changes
React
<Activity />was developed over many years, starting beforeClassComponent.setState(@acdlite @sebmarkbage and many others)%oplaceholder (@eps1lon #34198)useDeferredValueloop in popstate event (@acdlite #32821)useDeferredValue(@acdlite #34376)cacheSignal(@sebmarkbage #33557)React DOM
:for IDs generated byuseId(@sebmarkbage, @eps1lon: #32001, #33342 #33099, #33422)nonceto be used on hoistable styles (@Andarist #32461)React.useinsideReact.lazy-ed Component (@hi-ogawa #33941)progressiveChunkSizeoption for server-side-rendering APIs (@sebmarkbage #33027)React Server Components
<img>and<link>using hints before they're rendered (@sebmarkbage #34604)filterStackFrame(@eps1lon #33707)React Reconciler
on*handlers to account for upcoming experimental APIsv19.1.1Compare Source
React
v19.1.0Compare Source
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.
#32538, #32529, #32538
React
useIdto use valid CSS selectors, changing format from:r123:to«r123». #32001React DOM
hrefattribute is an empty string #31783getHoistableRoot()didn’t work properly when the container was a Document #32321<!-- -->) as a DOM container. #32250<script>and<template>tags to be nested within<select>tags. #31837use-sync-external-store
exportsfield topackage.jsonforuse-sync-external-storeto support various entrypoints. #25231React Server Components
unstable_prerender, a new experimental API for prerendering React Server Components on the server #31724registerServerReferencein client builds to handle server references in different environments. #32534v19.0.0Compare Source
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.
New Features
React
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.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.<head>section of the document.<head>on the client before revealing the content of a Suspense boundary that depends on that stylesheet.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
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
Deprecations
element.refaccess: React 19 supports ref as a prop, so we’re deprecatingelement.refin favor ofelement.props.ref. Accessing will result in a warning.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 @testing-library/react or @testing-library/react-nativeBreaking 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
onUncaughtErrorandonCaughtErrormethods tocreateRootandhydrateRootto customize this error handling.propTypes: UsingpropTypeswill now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.defaultPropsfor functions: ES6 default parameters can be used in place. Class components continue to supportdefaultPropssince there is no ES6 alternative.contextTypesandgetChildContext: Legacy Context for class components has been removed in favor of thecontextTypeAPI.React.createFactory: Now that JSX is broadly supported, allcreateFactoryusage can be migrated to JSX components.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 @testing-library/react or @testing-library/react-native instead.React DOM
react-dom/test-utils: We’ve movedactfromreact-dom/test-utilsto react. All other utilities have been removed.ReactDOM.render,ReactDOM.hydrate: These have been removed in favor of the concurrent equivalents:ReactDOM.createRootandReactDOM.hydrateRoot.unmountComponentAtNode: Removed in favor ofroot.unmount().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>.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.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.React DOM
TypeScript Changes
The most common changes can be codemodded with
npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files.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)prop-types:Requireable,ValidationMap,Validator,WeakValidationMapcreate-react-class:ClassicComponentClass,ClassicComponent,ClassicElement,ComponentSpec,Mixin,ReactChildren,ReactHTML,ReactSVG,SFCFactoryuseRef: The initial argument is now required to matchuseState,createContextetcuseRef()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.ReactElementtyping: The props of React elements now default tounknowninstead ofanyif the element is typed asReactElementJSXnamespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package:import { JSX } from 'react'useReducertypings: MostuseReducerusage should not require explicit type arguments.For example,
All Changes
React
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, #28319 by @acdlite, @eps1lon, and @rickhanlonii)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, #28233 by @acdlite, @MofeiZ, @sebmarkbage, @sophiebits, @eps1lon, and @hansottowirtz)useOptimistic()hook to display mutated state optimistically during an async mutation (#26740, #26772, #27277, #27453, #27454, #27936 by @acdlite)initialValueargument touseDeferredValue()hook (#27500, #27509, #27512, #27888, #27550 by @acdlite)element.refaccess (#28348, #28464, #28731 by @acdlite)<Context>to mean<Context.Provider>(#28226 by @gaearon)info,group, andgroupCollapsedin StrictMode logging (#25172 by @timneutkens)useSyncExternalStore()hydration in StrictMode (#26791 by @sophiebits)componentWillUnmount()in StrictMode (#26842 by @tyao1)useState()anduseReducer()initializer functions in StrictMode (#28248 by @eps1lon)useId()in StrictMode (#25713 by @gnoff)act()no longer checksshouldYieldwhich can be inaccurate in test environments (#26317 by @acdlite)react.elementsymbol toreact.transitional.element(#28813 by @sebmarkbage)useSyncExternalStore()re-render (#27199 by @acdlite)useSyncExternalStore()dropped update when state is dispatched in render phase (#25578 by @pandaiolo)RefreshRuntime.findAffectedHostInstances(#30538 by @gaearon)cache()API (#27977, #28250 by @acdlite and @gnoff)propTypes(#28324, #28326 by @gaearon)defaultPropssupport, except for classes (#28733 by @acdlite)createFactory(#27798 by @kassens)React DOM
useFormStatus()hook to provide status information of the last form submission (#26719, #26722, #26788, #29019, #28728, #28413 by @acdlite and @eps1lon)preinit,preinitModule,preconnect,prefetchDNS,preload, andpreloadModuleAPIs.fetchPriorityto<img>and<link>(#25927 by @styfle)transformOriginprop (#26130 by @arav-ind)onScrollEndevent (#26789 by @devongovett)<hr>as child of<select>(#27632 by @SouSingh)inert(#24730 by @eps1lon)imageSizesandimageSrcSet(#22550 by @eps1lon)flushSyncexhausts queue even if something throws (#26366 by @acdlite)reactandreact-domversions don’t match (#29236 by @acdlite)srcsetandsrcare assigned last on<img>instances (#30340 by @gnoff)srcandhrefattributes (unless for<a href="" />) (#18513, #28124 by @bvaughn and @eps1lon)scalestyle property (#25601 by @JonnyBurger)onChangeerror message for controlled<select>(#27740 by @Biki-das)render,hydrate,findDOMNode,unmountComponentAtNode,unstable_createEventHandle,unstable_renderSubtreeIntoContainer, andunstable_runWithPriority. MovecreateRootandhydrateRoottoreact-dom/client. (#28271 by @gnoff)test-utils(#28541 by @eps1lon)unstable_flushControlled(#26397 by @kassens)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.