Where should we persist the theme preference in an SSR app?


Implementing dark mode often seems like a trivial feature. In practice, it turns out to be surprisingly tricky in server-rendered applications.

In a purely client-side app, persisting the theme preference is straightforward: store the value somewhere in the browser like localStorage...