Next.js Discord

Discord Forum

useContext for Themeing not working on remote Production Netlify

Unanswered
Manchester Terrier posted this in #help-forum
Open in Discord
Manchester TerrierOP
I have an app where I using reacts useContext to have a ThemeProdivder where user can choose bewtween 3 color themes. I got it to work locally where the user can choose a theme color and go to another page route and the theme selection will stay selected.

However when deploying to Netlify production, it doesn't keep the selected theme when going to a new page. It load back the default theme.
I have tested Next.js production build on my local and it works fine.

How should I solve this and why is this happening?

I plan i storing the theme state variable in a session to see if that would solve it.

0 Replies