[Tanstack Start] Inject data into router context using React hook/context #6933
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 |
Beta Was this translation helpful? Give feedback.
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?
Beta Was this translation helpful? Give feedback.
All reactions