material-dashboard-react
material-dashboard-react copied to clipboard
Save theme values
Hi! I need help saving theme values using local storage method, when you pick dark mode and reload you get the default value how can I storage that value and retrieve it after reload ! Thanks in advance
You really should be using an api with some kind database to achieve this. The values can be saved in localstorage on the browser or even in cookies, but you probably know that this is not a good solution because it will only work for that browser. These templates are not for production use, they are only demos of the template.
You can use localStorage as in this article: https://www.freecodecamp.org/news/how-to-use-localstorage-with-react-hooks-to-set-and-get-items/
The values for the darkmode in the state for the gear settings component,
Hope this answers your question.