tanstack-router

Create type-safe file-based routes with loaders for React and Solid apps.

29|2|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/tanstack-skills/tanstack-skills --skill tanstack-router-tanstack-skills
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-router
Source: https://github.com/tanstack-skills/tanstack-skills/tree/main/plugins/tanstack-router/skills/tanstack-router
Command: npx skills add https://github.com/tanstack-skills/tanstack-skills --skill tanstack-router-tanstack-skills

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building complex, type-safe navigation in React and Solid apps with file-based routing, built-in data loading, and strong TypeScript integration can be verbose and error-prone; this Skill centralizes routing concerns and provides a cohesive approach that aligns with TanStack's ecosystem.

Core Features & Use Cases

  • Type-safe file-based routing for React and Solid with integrated route schemas and TS support.
  • Built-in data loading, loaders, and search params management to drive UI data.
  • Code-splitting, lazy loading, and deep integration with TanStack ecosystem for scalable apps.
  • Use cases include dashboards, admin panels, and content-driven sites that require robust navigation and data flow.

Quick Start

Create a basic route using createFileRoute('/'), attach a loader to fetch data, and render it within a RouterProvider.

Frequently Asked Questions about tanstack-router

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up type-safe routing in React with file-based routes?

Type-safe routing in React uses file-based route definitions to generate TypeScript-aware route links and parameters. You create routes using createFileRoute, attach loaders for data fetching, and render via RouterProvider to ensure navigation and data flow are fully type-checked.

Can I use this router for Solid apps or is it limited to React?

This router supports both React and Solid applications for type-safe, file-based routing. It enforces type-safe route definitions and loader integration across both frameworks, allowing you to build navigable, data-driven apps within the TanStack ecosystem.

How does built-in data loading work with route loaders and search params?

Built-in data loading works by attaching loaders to route definitions to fetch data before rendering, while search param management drives UI data. This approach centralizes routing concerns and ensures data flow is tightly integrated with type-safe route schemas.

What's the best way to handle code-splitting and lazy loading in a type-safe React router?

The best way to handle code-splitting is using a type-safe router that integrates lazy loading directly into its file-based route definitions. This ensures scalable apps with robust navigation by enforcing type safety across dynamically loaded route components and loaders.

Why should I use a type-safe router instead of manually managing routes and TypeScript types?

A type-safe router prevents the verbose and error-prone process of manually managing routes and TypeScript types. It centralizes routing concerns, enforces type-safe route definitions, and provides deep TS tooling to ensure navigation, search params, and data loaders are fully validated.

Are there limitations when using file-based routing for complex dashboards and admin panels?

File-based routing is well-suited for complex dashboards and admin panels, requiring robust navigation and data flow. There are no inherent limitations mentioned for these use cases; it supports code-splitting and deep ecosystem integration to handle scalable applications.