Load theme from cookies without fouc
I want to load my theme from cookiees without a flash of unstyled content (nextjs), is it wise to use a synchronous script tag for this?
6 Replies
parse the cookie information in getServerSideProps as pass it as a prop
I have a lot of static pages
well that's contradictory
mostly static with a bit of js shipped to make the theme interactive 😂
well if you're not going to be styling it on the server, there's no way to prevent a flash of unstyled content
reading local cookies seems to be the one exception to that, its fast enough to prevent it
its working well, I was just wondering if there's a better way