You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys! What if I want to have multiple themes but the values stored in a database so each user can style the website as they please? I want to avoid any colors layout shift.
// layout server componentconsttheme=awaitgetTheme(user.id)<SetThemetheme={theme}/>// client component with useEffect
Getting them as this and then using a useEffect to set them in localStorage(for example) makes the app colors shift from none to the actual values. How can I avoid this!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys! What if I want to have multiple themes but the values stored in a database so each user can style the website as they please? I want to avoid any colors layout shift.
Getting them as this and then using a useEffect to set them in
localStorage
(for example) makes the app colors shift from none to the actual values. How can I avoid this!Beta Was this translation helpful? Give feedback.
All reactions