You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the mui-color-scheme-dark property to dark manually then the change happens, can someone explain me how these properties of the localstorage 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.
danilo-leal
changed the title
How does the configuration of the selected schema work in the localstorage? I have 3 properties
[system][question] Issues with using useColorScheme with localstorage
May 7, 2024
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
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
The text was updated successfully, but these errors were encountered: