react-css-theme-switcher
react-css-theme-switcher copied to clipboard
the page starts without any styling, how can I change it?
when I enter the app it shows a page without formatting for a short period, is there a solution for that?
Already covered in Readme.
Usage -> Use useThemeSwitcher Hook:
if (status === 'loading') { return <div>Loading styles...</div>; }
But this status check causes rendering components twice. I was able to fix it like this:
if (status !== 'loaded') { return <div>Loading styles...</div>; }
Hope it helps :)