-
Notifications
You must be signed in to change notification settings - Fork 12.5k
React version split — web app pins React 18.2.0 while root resolutions force React 19.2.4 #28634
Copy link
Copy link
Open
Description
Description
There is a version conflict in the React dependency tree:
apps/web/package.jsondeclares"react": "18.2.0"and"react-dom": "18.2.0"- Root
package.jsonresolutions forcereact@19.2.0,19.2.1, and19.2.2to all resolve to19.2.4 @types/reactis pinned at"18.0.26"in both the web app and root resolutionsnextis at16.1.5, which has a peer dependency on React 19
Impact
Depending on hoisting behavior, some packages may get React 18, others React 19, while TypeScript types always reflect React 18 regardless. This creates:
- Hydration mismatches — React 18 and 19 have different hydration behavior, leading to hard-to-reproduce SSR bugs
- Type safety gaps —
@types/react@18does not include React 19 APIs (use(),useActionState, etc.), so usage compiles but types are wrong - Ref forwarding breakage — React 19 changed ref handling, and mixed versions cause inconsistent behavior (likely related to Migrate off Next.js <Link legacyBehavior> — hydration, ref-forwarding, and runtime fixes #24417)
Proposed Fix
Establish a single React version across the monorepo. Either:
- Complete the React 19 migration: update
apps/webtoreact: "19.2.4", update@types/reactto19.x - Pin everything to React 18: remove the root resolutions that force 19.x until migration is ready
Document the chosen version in CONTRIBUTING.md to prevent version drift.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels