// index.lazy.tsx
import { createLazyFileRoute } from "@tanstack/react-router";
function Index() { }
export const Route = createLazyFileRoute("/")({
component: Index
});
This code snippet was copied from Tanstack Router - Quick Start
Tanstack Router generates a file routeTree.gen.ts
which declares the interface FileRoutesByPath
that createLazyFileRoute
uses to map the possible paths. You can either run tsr watch
or tsr generate
or, if using a bundler plugin, build your project or start a dev server.
Here is a guide on setting up the file based router for different environments.