react-dark-mode-toggle
react-dark-mode-toggle copied to clipboard
Flash when dark mode is the default mode
If the CSS is setup to default to light mode, but the user selects dark mode, the next time they visit the app, they will be in dark mode. However, the user will see a flash of light mode before the app is spun up and useDarkMode is called.
I have this issue as well...
I branched off of this repo and created react-dark-mode-toggle-2 to solve this problem and merge an outstanding PR.
If you have the bandwidth, please give it a try: https://github.com/todd-elvers/react-dark-mode-toggle-2