Multi-store with server persistence

- User's preferred themes are persisted in cookies on the server and in memory on the client
- Theme selection is only saved upon form submission
- To avoid the flashing of wrong theme value, consider putting it in a dropdown menu, or rendering multiple sets and use CSS to show the correct one based on the theme wrapper's attributes


These 2 sections read from the same theme store



Demo links

App Router

Basic usage →
Multi-store with server persistence →
Multi-store with no hydration mismatch →

Pages Router

Basic usage →
Multi-store with server persistence →
Multi-store with no hydration mismatch →