Back to Router

TanStack Router - File-Based Routing Example

examples/react/basic-file-based/README.md

1.166.7719 B
Original Source

TanStack Router - File-Based Routing Example

An example demonstrating file-based routing with TanStack Router.

Start a new project based on this example

To start a new project based on this example, run:

sh
npx gitpick TanStack/router/tree/main/examples/react/basic-file-based basic-file-based

Getting Started

Install dependencies:

sh
pnpm install

Start the development server:

sh
pnpm dev

Build

Build for production:

sh
pnpm build

About This Example

This example demonstrates:

  • File-based route generation
  • Automatic route tree creation
  • Route file conventions
  • Type-safe routing with file-based routes