server side localstorage?

Any way to access local storage or cookies server side? I have some light/dark theming in my app, but when loading, there's a blink of the light theme even when it says dark in localStorage for example. Is there any way to avoid this?
5 Replies
Maj
Maj13mo ago
cookies yes. localstorage no local storage is client side only. Cookies are sent if they exist in each request res.cookies
barry
barry13mo ago
see how next-themes does it or literally just use it
Maj
Maj13mo ago
ye next-theme is perfect for that.
niels
niels13mo ago
ill look into it didnt know of its existence
Maj
Maj13mo ago
👍