call `createServerData$` outside Route?
Can I call
createServerData$ outside of a Route?
I want to put it in a header that is outside of my routes. Do I need to create a "master route" that has children?2 Replies
I think that
createServerData$ is routeData + useRouteData + createResource + server$
Why not use just use createResource + server$? if you want to call it in root, you don't get any code-splitting benefit of routeData
ah nvm, it's a wrapper around createRouteData, not routeData
but does it really have a limitation that is has to be called in a route?hey thanks @thetarnav I'm pretty new to Solid Start so I actually didn't even know about the standalone server$...
I'm using the auth.js example
I'm trying to rewrite it with only
createResource + server$:
Normally it seems like createResource should take an async function so I'm not 100% sure if I did this right.
Huh, actually the original
worked. I just accidentally had my header inside the routes instead of outside:
↓
I'm still a bit curious how the createResource + server$ would work