| # Routes |
|
|
| TanStack Start uses **file-based routing**. Every `.tsx` file in this directory |
| is a route. Do **not** create `src/pages/`, `src/routes/_app/index.tsx`, or |
| `app/layout.tsx` β those are Next.js / Remix conventions. The only root layout |
| is `src/routes/__root.tsx`. |
|
|
| ## Conventions |
|
|
| | File | URL | |
| | --- | --- | |
| | `index.tsx` | `/` | |
| | `about.tsx` | `/about` | |
| | `users/index.tsx` | `/users` | |
| | `users/$id.tsx` | `/users/:id` (dynamic β bare `$`, no curly braces) | |
| | `posts/{-$category}.tsx` | `/posts/:category?` (optional segment) | |
| | `files/$.tsx` | `/files/*` (splat β read via `_splat` param, never `*`) | |
| | `_layout.tsx` | layout route (renders children via `<Outlet />`) | |
| | `__root.tsx` | app shell β wraps every page; preserve `<Outlet />` | |
|
|
| `routeTree.gen.ts` is auto-generated. Don't edit it by hand. |
|
|