Replies: 3 comments 11 replies
-
|
you can set |
Beta Was this translation helpful? Give feedback.
-
|
Hi! We're running into the same issue. We're using Relay with TanStack Router and are looking to migrate to TanStack Start, but we'd like to avoid having to use the workaround on every route. Are there any plans to support disabling SSR without needing that workaround? |
Beta Was this translation helpful? Give feedback.
-
|
For partially disabling SSR during migration, you can use the In TanStack Start, try this approach: // routes/legacy-section.tsx
export const Route = createFileRoute("/legacy-section")({
// Disable SSR for this route tree
ssr: false,
component: LegacySection,
})For a whole subtree, you can set this in the parent route and it should cascade down. Alternatively, use export const Route = createFileRoute("/legacy")({
loader: async () => {
if (typeof window === "undefined") {
// Return minimal data for SSR
return { data: null }
}
// Full data fetch on client
return { data: await fetchData() }
}
})This lets you incrementally adopt SSR for new routes while keeping existing code client-only. The migration can then happen route-by-route. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are looking to migrate a big codebase to tanstack/router and would love to also start using tanstack/start to enable SSR.
Due to the size of the codebase we would like to disable SSR for most of our current code and only use it for anything new we add.
I have tried to find anything about this in the docs and on github, but I could not find a related option to configure a route (and all subroutes) to be excluded from SSR.
Is there an undocumented config option or a good way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions