DEV Community

Discussion on: No Fuss Dark-Mode Toggle with React & Styled-Components! πŸŒžβ†”οΈπŸŒ–

Collapse
 
hyggedev profile image
Chris Hansen

This is definitely not the end goal. For beginners who are testing the waters, this is the easiest way imo to get something up and running asap. Context and Local storage would make this much better. But as for styled-components, this totally works!

Collapse
 
goodok21 profile image
Alexander Eric

You want to provide context about dark mode? And get this context state in components and then pass as props again to styled components? ;) just use styled-components theme, and to persist state you can use local storage for sure πŸ˜‰

Beginners need to learn good patterns - this is the most important thing, imho πŸ™‚

Thread Thread
 
hyggedev profile image
Chris Hansen

Update coming soon πŸ˜‰