Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request updates the React dependency to version 19.2.0. A critical issue was identified regarding a version mismatch between react and react-dom, which must be updated together to prevent runtime errors. Additionally, the review suggests updating type definitions, migrating the entry point to the createRoot API, and using the caret prefix for version consistency.
| "miragejs": "^0.1.43", | ||
| "polished": "^4.1.4", | ||
| "react": "^17.0.2", | ||
| "react": "19.2.0", |
There was a problem hiding this comment.
Upgrading react to version 19 while leaving react-dom at version 17 (line 18) will cause runtime errors due to a version mismatch. These packages must be updated in tandem to the same version. Additionally, the following updates are required for a successful migration to React 19:
- Update
@types/reactand@types/react-domto version 19 to avoid TypeScript compilation errors. - Update the application entry point in
src/index.tsxto use thecreateRootAPI, asReactDOM.renderis deprecated and behaves differently in React 19. - Use the caret (
^) prefix for the version string to maintain consistency with the other dependencies in this file.
| "react": "19.2.0", | |
| "react": "^19.2.0", |
Bumps
reactfrom^17.0.2to19.2.0.Changelog
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, [Fizz] Block on Suspensey Fonts during reveal facebook/react#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 APIseslint-plugin-react-hooks@6.1.0
Note: Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes.
recommendedpreset. Legacy config moved torecommended-legacy. (@michaelfaith in #32457)usewithin try/catch blocks. (@poteto in #34040)useEffectEventfunctions in arbitrary closures. (@jbrown215 in #33544)React.useEffectin addition touseEffectin rules-of-hooks. (@Ayc0 in #34076)react-hookssettings config option that to acceptadditionalEffectHooksthat are used across exhaustive-deps and rules-of-hooks rules. (@jbrown215) in #34497