Open sawa-ko opened 2 weeks ago
Can you link a working demo (a Github repo or a Codesandbox/Stackblitz link) ? It'll be easier to debug.
@brijeshb42 I have updated the issue with the link to the bug reproduction.
@siriwatknp This might be your area of expertise. Seems related to @mui/material-nextjs
.
Steps to reproduce
Link to live example: https://codesandbox.io/p/github/sawa-ko/nextjs-app-router-mui-bug/main
Steps:
Current behavior
Actually I want to change the theme of my application following the migration guide that mui has in its documentation, but something strange happens.
The hook changes the mui-mode property of the
localstorage
however there are 2 more properties that are also marked as a kind of setting for the color scheme.The strange thing is that when the hook changes that property of the
localstorage
nothing happens, but if I change themui-color-scheme-dark
property todark
manually then the change happens, can someone explain me how these properties of thelocalstorage
work?It is necessary to emphasize that I have not created them, mui creates them automatically.
Expected behavior
That when the hook changes the color scheme is actually changed, and that there is an explanation of how these settings work in the documentation because I searched and found nothing.
Context
Change the color scheme.
Your environment
``` $ pnpx @mui/envinfo System: OS: Windows 11 10.0.22631 Binaries: Node: 20.12.2 - C:\Program Files\nodejs\node.EXE npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD pnpm: 9.0.6 - C:\Program Files\nodejs\pnpm.CMD Browsers: Chrome: Not Found Edge: Chromium (124.0.2478.51) npmPackages: @emotion/react: ^11.11.4 => 11.11.4 @emotion/styled: ^11.11.5 => 11.11.5 @mui/material: ^5.15.16 => 5.15.16 @mui/material-nextjs: ^5.15.11 => 5.15.11 @types/react: ^18 => 18.3.1 react: ^18 => 18.3.1 react-dom: ^18 => 18.3.1 typescript: ^5 => 5.4.5 ```npx @mui/envinfo
I am using microsoft edge in its version: 124.0.2478.80
Search keywords: useColorScheme, mui-color-scheme-dark, mui-color-scheme-light, mui-mode, localstorage scheme, localstorage mui mode