Run the project and explain the two core files in src/routes.
Generate the project
The official CLI creates a TanStack Start project by default. Use the blank option while learning to reduce starter-code noise.
npx @tanstack/cli@latest create my-app --blank -y
cd my-app
pnpm devFind two files first
__root.tsx defines the HTML document and global layout; index.tsx is the root page. routeTree.gen.ts is generated and should not be edited by hand.
Turn this lesson into a verifiable skill
The development server starts and the generated route tree recognizes both the root and index routes.
Add an `/about` file route, show the app name, and navigate to it from the index using a type-safe Link.
Run typecheck and directly load both `/` and `/about`; both URLs should survive refresh with no type errors.
- Editing the generated routeTree file by hand.
- Putting the root document structure in a normal child route.