donavon / use-dark-mode

A custom React Hook to help you implement a "dark mode" component.
MIT License
1.28k stars 100 forks source link

Query initial state synchronously #77

Open aghoneim92 opened 3 years ago

aghoneim92 commented 3 years ago

Since we can both read from localStorage and find the media query value synchronously at startup, the flash situation could be avoided if there's no server-side rendering or static site generation. I would love to implement this, and would like to know the maintainers' thoughts about it.