#What's the point of context in clientLoader, and how to use it?

1 messages · Page 1 of 1 (latest)

final arrow
#

I mean, I know that you can create a context in the server and pass it to loaders. But seeing as that same context isn't being passed to clientLoaders, just wondering where I would make a context for them. Thanks!

zinc creek
#

right now it's not possible to use it

final arrow
#

awesome

#

thanks a lot!

zinc creek
#

once that's merged you will be able to pass a context object to createBrowserRouter and in framework mode to HydratedRouter

#

then that value will be accessible in your client loaders

final arrow
#

got it. yeah, was just looking through the pr. that's really interesting. that would mean that we'd be making another layer essentially. before mounting our app, we'd need to get/set everything in our client context. if that stuff is asynchronous, how would ssr look like?

#

just rambling here 😆

zinc creek
#

that shouldn't affect SSR

#

on SSR the client loaders never run

#

so your app will SSR as always