Shimano
Confused with SolidStart and context provider
Hello. First of all - complete noob in frontend dev. I have a problem with the context and context providers.
I saw some basic tutorial for React and AuthContext - basically a context that contains a login, logout functions and hooks for the user and the user's token.
I have adapted it for Solid (somewhat) and tried it in plain SolidJS - it worked fine.
So I tried yoinking it to SolidStart with the same idea - wrap my app in an AuthProvider and call a useAuth hook where I need to do stuff with auth.
Well the context is always undefined... Again, I am a complete noob and I may be doing things completely wrong. If you can help me or show me another way to solve my issue, I'd appreciate it.
Will share code below.
28 replies