TanStackT
TanStack12mo ago
7 replies
dangerous-fuchsia

What is the expected behaviour of ssr:false

I asked a previous question that ssr:false breaks vinxi. I now use https://tanstack.com/router/v1/docs/framework/react/examples/basic-ssr-file-based as my starting point so i only run "node server.js".
My entry-server.tsx is also identical. As soon as i set ssr:false on a route it is correctly not rendered on the server, but it is also not rendered on the client so it never appears. Do i need to declare the route differently?
This does not render anything:

import { createFileRoute } from "@tanstack/react-router";

export const Route = createFileRoute("/about")({
    component: About,
    ssr: false,
});

function About() {
    return <div className="p-2">Hello from About!</div>;
}
An example showing how to implement Basic Ssr File Based in React using TanStack Router.
React TanStack Router Basic Ssr File Based Example | TanStack Route...
Was this page helpful?