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•3y ago
parse the cookie information in getServerSideProps as pass it as a prop
AdmiralGeneralAladeen
AdmiralGeneralAladeenOP•3y ago
I have a lot of static pages
Samathingamajig
Samathingamajig•3y ago
well that's contradictory
AdmiralGeneralAladeen
AdmiralGeneralAladeenOP•3y ago
mostly static with a bit of js shipped to make the theme interactive 😂
Samathingamajig
Samathingamajig•3y 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
AdmiralGeneralAladeenOP•3y ago
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