[system] useColorScheme should return null during hydration #41918
Labels
breaking change
package: pigment-css
Specific to @pigment-css/*
package: system
Specific to @mui/system
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
No response
Current behavior
useColorScheme()
returns a default value during hydration leading to confusion: it's not accurate and prevents combinatory logic like below.Expected behavior
I would expect it to return
null
, see:material-ui/docs/src/components/header/ThemeModeToggle.tsx
Lines 37 to 46 in 418fb02
for a use case.
Context
I saw this in #41223.
Your environment
npx @mui/envinfo
Search keywords: -
The text was updated successfully, but these errors were encountered: