[Tanstack Start] Inject data into router context using React hook/context #6933
Unanswered
kaleemullah786
asked this question in
Q&A
Replies: 1 comment 2 replies
|
In TanStack Start, the router is created on the server side via The pattern that works: use // routes/__root.tsx
export const Route = createRootRouteWithContext()({
beforeLoad: async () => {
const auth = await getAuthState({ data: undefined })
return { auth }
},
})This runs server-side during SSR, serializes to the client, and avoids hydration mismatches. The |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm migrating from Tanstack Router where I've:
how can I achieve the same in Tanstack Start?
All reactions