Cannot make react context work during SSR
I made a simple ThemeContext, I have a providers file which is loading all the providers.
In a component I'm trying to call my
useTheme hook.
I'm getting this error whenever a route is having a call to useTheme on server side, on client side it works.
Not sure what I'm missing.8 Replies
rival-black•2mo ago
can you please provide a complete project?
conscious-sapphireOP•2mo ago
no, it's a private project at work
rival-black•2mo ago
then create a minimal example based on one of our examples
conscious-sapphireOP•2mo ago
GitHub
GitHub - wintercounter/repro-ts-start-provider-issue: Created with ...
Created with CodeSandbox. Contribute to wintercounter/repro-ts-start-provider-issue development by creating an account on GitHub.
conscious-sapphireOP•2mo ago
here you go
created a
test route
it's also happening with itconscious-sapphireOP•2mo ago

conscious-sapphireOP•2mo ago
@Manuel Schiller Should I make a GH issue? Not sure if I'm getting something wrong or it's an actual bug.
rival-black•2mo ago
sure create an issue for that
we'll find out either way