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
Samathingamajig
Samathingamajig•2y ago
parse the cookie information in getServerSideProps as pass it as a prop
AdmiralGeneralAladeen
I have a lot of static pages
Samathingamajig
Samathingamajig•2y ago
well that's contradictory
AdmiralGeneralAladeen
mostly static with a bit of js shipped to make the theme interactive 😂
Samathingamajig
Samathingamajig•2y ago
well if you're not going to be styling it on the server, there's no way to prevent a flash of unstyled content
AdmiralGeneralAladeen
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
Want results from more Discord servers?
Add your server