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

Dark theme issue in mobile screens #7

Open
iampsr8 opened this issue Oct 6, 2022 · 2 comments
Open

Dark theme issue in mobile screens #7

iampsr8 opened this issue Oct 6, 2022 · 2 comments

Comments

@iampsr8
Copy link

iampsr8 commented Oct 6, 2022

@arpanaditya After changing to dark theme, when clicked on the navbar icon, the theme gets toggled to light theme even before getting inside the navbar and selecting dark theme.

@arpanaditya
Copy link
Contributor

@iampsr8 Thanks for bringing this to notice. I can't seem to find what's causing the problem. Could you please help?

@iampsr8
Copy link
Author

iampsr8 commented Oct 7, 2022

@arpanaditya From what I seem to find you have implemented the set-theme state in the mobile component itself, where the useState is initialized with the light theme, so when we click on the mobile nav icon the mobile component opens and the theme gets initialized with light theme, analogous to that the same thing will happen in the web version as well i.e. when you reload the page in web the theme gets initialized with light theme. Instead of creating the state in the individual component you can create in the App.js file. Here I am linking some resources to help you

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