Skip to content

[v7] Hydration mismatch issues with React Router 7 Spa Mode #45834

@bryanjtc

Description

@bryanjtc

Steps to reproduce

Steps:

  1. Open this link to live example: (repo)
  2. Install dependencies with yarn install
  3. Run the dev server with yarn start

Current behavior

Hydration errors and ui doesn't render styles correctly
Image

Expected behavior

I should be able to use the new material ui 7 version without hydration error in react router spa mode and react 18

Context

The ui should render correctly
Related: #44993 (comment)

Your environment

npx @mui/envinfo
I used Brave Browser
System:
    OS: Windows 11 10.0.26100
  Binaries:
    Node: 22.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
    Edge: Chromium (131.0.2903.70)
  npmPackages:
    @emotion/react: 11.14.0 => 11.14.0 
    @emotion/styled: 11.14.0 => 11.14.0 
    @mui/core-downloads-tracker:  7.0.1 
    @mui/icons-material: 7.0.1 => 7.0.1 
    @mui/material: 7.0.1 => 7.0.1 
    @mui/private-theming:  7.0.1 
    @mui/styled-engine:  7.0.1 
    @mui/system: 7.0.1 => 7.0.1 
    @mui/types:  7.4.0 
    @mui/utils:  7.0.1 
    @mui/x-charts: 8.0.0-beta.3 => 8.0.0-beta.3
    @mui/x-charts-vendor:  8.0.0-beta.3
    @mui/x-data-grid: 8.0.0-beta.3 => 8.0.0-beta.3
    @mui/x-date-pickers: 8.0.0-beta.3 => 8.0.0-beta.3
    @mui/x-internals:  8.0.0-beta.3
    @mui/x-tree-view: 8.0.0-beta.3 => 8.0.0-beta.3
    @types/react: 18.3.20 => 18.3.20
    react: 18.3.1 => 18.3.1
    react-dom: 18.3.1 => 18.3.1
    typescript: 5.8.2 => 5.8.2

Search keywords: react router, hydration, v7

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions