← All posts

File-based Routing

2026-05-12

Each file in src/routes becomes a route. __root.tsx is the shared layout, index.tsx is the home, and dynamic segments use a $ prefix like $slug.tsx.

The generated route tree lives in src/routeTree.gen.ts — it's rewritten on every save while the dev server is running.