Question · Next.js course · Module 3: Styling and Visual Optimization
Persisting the theme preference
Where did the lesson store the user's chosen theme so it survives a page refresh?
Answer options
- In localStorage (localStorage.setItem('theme', ...))
- In the next.config.js file
- In a global window.theme variable
- In a cookie set by the SSR server
You can check the correct answer by solving this task in the CodeWorlds game.