Update react monorepo to v19 #193
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/react-monorepo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
18.2.31->19.2.718.2.0->19.2.118.2.0->19.2.1Release Notes
facebook/react (react)
v19.2.1Compare Source
React Server Components
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.2Compare Source
React Server Components
v19.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.1Compare Source
React Server Components
v19.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)renderToStaticNodeStream()(#28873 by @gnoff)unstable_renderSubtreeIntoContainer(#29771 by @kassens)React DOM Server
bootstrapScriptsandbootstrapModules(#25104 by @gnoff)bootstrapModules,bootstrapScripts, and update priority queue (#26754, #26753, #27190, #27189 by @gnoff)onHeadersentrypoint option (#27641, #27712 by @gnoff)<style>and<script>textContent to enable rendering inner content without dangerouslySetInnerHTML (#28870, #28871 by @gnoff)srcsetto trigger load event on mount (#30351 by @gnoff)onError(#27761, #27850 by @gnoff and @sebmarkbage)crossoriginsupport to bootstrap scripts (#26844 by @HenriqueLimas)nonceandfetchpriorityin preload links (#26826 by @liuyenwei)referrerPolicytoReactDOM.preload()(#27096 by @styfle)react/jsx-dev-runtime(#28921 by @himself65)errorInfo.digestfromonRecoverableError(#28222 by @gnoff)ReactTestRenderer
react-test-rendereron web (#27903, #28904 by @jackpope and @acdlite)react-test-renderer/shallowexport (#25475, #28497 by @sebmarkbage and @jackpope)React Reconciler
prepareUpdate(#26583, #27409 by @sebmarkbage and @sophiebits)React-Is
isConcurrentModeandisAsyncModemethods (#28224 by @gaearon)useSyncExternalStore
v18.3.1Compare Source
actfromreactf1338fv18.3.0Compare Source
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
this.refsto support string ref codemod 909071findDOMNodeoutside StrictMode c3b283test-utilsmethods d4ea75defaultPropsfor function components #25699key#25697actfromtest-utilsd4ea75React DOM
unmountComponentAtNode8a015brenderToStaticNodeStream#28874Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot.
⚠ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: pnpm-lock.yaml
Update dependency @types/react to v18.2.32to Update dependency @types/react to v18.2.3326a1162d7eto6188e826d5Update dependency @types/react to v18.2.33to Update dependency @types/react to v18.2.346188e826d5to4519f87079Update dependency @types/react to v18.2.34to Update dependency @types/react to v18.2.354519f87079to9e04fe84e5Update dependency @types/react to v18.2.35to Update dependency @types/react to v18.2.369e04fe84e5to925c9d73f9Update dependency @types/react to v18.2.36to Update dependency @types/react to v18.2.37925c9d73f9to06739b0eadUpdate dependency @types/react to v18.2.37to Update dependency @types/react to v18.2.3806739b0eadto347d3d2983Update dependency @types/react to v18.2.38to Update dependency @types/react to v18.2.39347d3d2983to590fe12829Update dependency @types/react to v18.2.39to Update dependency @types/react to v18.2.40590fe12829toe76cdf6a81Update dependency @types/react to v18.2.40to Update dependency @types/react to v18.2.41e76cdf6a81to5faa0cd252Update dependency @types/react to v18.2.41to Update dependency @types/react to v18.2.425faa0cd252to5c171d5844Update dependency @types/react to v18.2.42to Update dependency @types/react to v18.2.435c171d5844to6aaa2018a1Update dependency @types/react to v18.2.43to Update dependency @types/react to v18.2.446aaa2018a1tob3f201af2bUpdate dependency @types/react to v18.2.44to Update dependency @types/react to v18.2.45b3f201af2bto5d7630655dUpdate dependency @types/react to v18.2.45to Update dependency @types/react to v18.2.465d7630655dtoa5d147f3b6Update dependency @types/react to v18.2.46to Update dependency @types/react to v18.2.47a5d147f3b6to1371e083a7Update dependency @types/react to v18.2.47to Update dependency @types/react to v18.2.481371e083a7tocc920f64caUpdate dependency @types/react to v18.2.48to Update dependency @types/react to v18.2.49cc920f64cato83f5ae3d57Update dependency @types/react to v18.2.49to Update dependency @types/react to v18.2.5083f5ae3d57to32a3fe472aUpdate dependency @types/react to v18.2.50to Update dependency @types/react to v18.2.5132a3fe472ato5a086ce535Update dependency @types/react to v18.2.51to Update dependency @types/react to v18.2.525a086ce535to32b36088b7Update dependency @types/react to v18.2.52to Update dependency @types/react to v18.2.5332b36088b7to37e89d88c0Update dependency @types/react to v18.2.53to Update dependency @types/react to v18.2.5437e89d88c0tod89844f77ad89844f77ato0e36e31d68Update dependency @types/react to v18.2.54to Update dependency @types/react to v18.2.55Update dependency @types/react to v18.2.55to Update dependency @types/react to v18.2.560e36e31d68to9e263c0c78Update dependency @types/react to v18.2.56to Update dependency @types/react to v18.2.579e263c0c78tof4d450fe84Update dependency @types/react to v18.2.57to Update dependency @types/react to v18.2.58f4d450fe84tocb8cbc8149Update dependency @types/react to v18.2.58to Update dependency @types/react to v18.2.59cb8cbc8149tod28572aa2dUpdate dependency @types/react to v18.2.59to Update dependency @types/react to v18.2.60d28572aa2dto8d8782b99bUpdate dependency @types/react to v18.2.60to Update dependency @types/react to v18.2.618d8782b99bto144c362b15Update dependency @types/react to v18.2.61to Update dependency @types/react to v18.2.62144c362b15to01521b4c7dUpdate dependency @types/react to v18.2.62to Update dependency @types/react to v18.2.6301521b4c7dto3e455c1b3fUpdate dependency @types/react to v18.2.63to Update dependency @types/react to v18.2.643e455c1b3fto69bbadcdafUpdate dependency @types/react to v18.2.64to Update dependency @types/react to v18.2.6569bbadcdafto33f47d8468Update dependency @types/react to v18.2.65to Update dependency @types/react to v18.2.6633f47d8468to64a5f4af14Update dependency @types/react to v18.2.66to Update dependency @types/react to v18.2.6764a5f4af14to5cc7cc7735Update dependency @types/react to v18.2.67to Update dependency @types/react to v18.2.685cc7cc7735to7c44fb24e7Update dependency @types/react to v18.2.68to Update dependency @types/react to v18.2.697c44fb24e7to97fb926bd4Update dependency @types/react to v18.2.69to Update dependency @types/react to v18.2.7097fb926bd4todecd9930f6Update dependency @types/react to v18.2.70to Update dependency @types/react to v18.2.71decd9930f6to84af09acc0Update dependency @types/react to v18.2.71to Update dependency @types/react to v18.2.7284af09acc0to016a74531aUpdate dependency @types/react to v18.2.72to Update dependency @types/react to v18.2.73016a74531atoeb15943fa2Update dependency @types/react to v18.2.73to Update dependency @types/react to v18.2.74eb15943fa2to67a1139546Update dependency @types/react to v18.2.74to Update dependency @types/react to v18.2.7567a1139546to62d4e5a80bUpdate dependency @types/react to v18.2.75to Update dependency @types/react to v18.2.7662d4e5a80btoed77bb19ddUpdate dependency @types/react to v18.2.76to Update dependency @types/react to v18.2.77ed77bb19ddtoeee8051d52Update dependency @types/react to v18.2.77to Update dependency @types/react to v18.2.78eee8051d52to38d565faf0Update dependency @types/react to v18.2.78to Update dependency @types/react to v18.2.7938d565faf0toe50877e419Update dependency @types/react to v18.2.79to Update react monorepoe50877e419to3c383d8a11Update react monorepoto Update react monorepo to v18.3.03c383d8a11toee2fa6223dUpdate react monorepo to v18.3.0to Update react monorepoee2fa6223dto538cfd5b81Update react monorepoto Update react monorepo to v18.3.1538cfd5b81to72a2095c3dUpdate react monorepo to v18.3.1to Update react monorepo72a2095c3dto559e846f29559e846f29to32ceeaa7db32ceeaa7dbto2db9c7a6b2⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: pnpm-lock.yaml
2db9c7a6b2toda160ec596da160ec596to2626b40d152626b40d15to22d44e709f22d44e709fto9a16d142b19a16d142b1tod540d27dcad540d27dcato98e47846c198e47846c1to97c18264f097c18264f0to07a6f92faf07a6f92fafto1d6dcf386e1d6dcf386etob73a75999bb73a75999bto93d5cc5022Update react monorepoto Update react monorepo to v1993d5cc5022tofa3f1950adfa3f1950adto7f20e724517f20e72451toe473d4117ae473d4117atoff1b3b0c7aff1b3b0c7atoba7a287529ba7a287529to3cfb9dfbaa3cfb9dfbaato22905f740422905f7404to0d697b1c5c0d697b1c5cto431d07f089431d07f089tod450d3c4fdd450d3c4fdto317be82c82317be82c82toda1ea90956da1ea90956to5fc5aa61435fc5aa6143tob07ee2ea3bb07ee2ea3btod4e2779a5cd4e2779a5cto42ed0f245042ed0f2450to98536f7c5798536f7c57to8d51f501368d51f50136to09edc51c3109edc51c31tofbb5ee849afbb5ee849ato35a545b74c35a545b74cto0a0e9035a20a0e9035a2to225bac72bd225bac72bdtoddec92bd8eddec92bd8etoeffd0fb525View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.