Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save theme values #226

Open
vberick opened this issue Oct 18, 2023 · 1 comment
Open

Save theme values #226

vberick opened this issue Oct 18, 2023 · 1 comment

Comments

@vberick
Copy link

vberick commented Oct 18, 2023

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

@waywardcode
Copy link

waywardcode commented Nov 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants