Skip to content

React version split — web app pins React 18.2.0 while root resolutions force React 19.2.4 #28634

@mahdirajaee

Description

@mahdirajaee

Description

There is a version conflict in the React dependency tree:

  • apps/web/package.json declares "react": "18.2.0" and "react-dom": "18.2.0"
  • Root package.json resolutions force react@19.2.0, 19.2.1, and 19.2.2 to all resolve to 19.2.4
  • @types/react is pinned at "18.0.26" in both the web app and root resolutions
  • next is at 16.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:

  1. Hydration mismatches — React 18 and 19 have different hydration behavior, leading to hard-to-reproduce SSR bugs
  2. Type safety gaps@types/react@18 does not include React 19 APIs (use(), useActionState, etc.), so usage compiles but types are wrong
  3. 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/web to react: "19.2.4", update @types/react to 19.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions