Initialize root router context from hook?
How do I initialize the root router context with a value from a hook? Is there any other way to take a value from a hook (which requires a context wrapper) and use it in the router context?
6 Replies
exotic-emerald•2mo ago
I think we could be going for the same thing. I attempted something like https://discord.com/channels/719702312431386674/1392868529736388699/1393112552929628231 but running into rendered HTML mismatch on RouteProvider
ugly-tanOP•2mo ago
Hm, interesting. Try with
ssr: false
, if you're running into issues with differences between the server and client. That is assuming you don't want to do SSR though.painful-plum•2mo ago
how do you envision this to work across server and client?
also , can you please share an example where that would be necessary?
exotic-emerald•2mo ago
I do have it ssr:false 😦 but apparently you gotta use StartClient
painful-plum•2mo ago
you would still need to render a shellComponent on the server
you cannot just render "nothing" on the server
ugly-tanOP•2mo ago
On the server, I would expect a default state I can use for the auth state (which is what I'm trying to implement here).