TanStack Router

Create type-safe file-based routing for React apps with TanStack Router.

18|4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/ataschz/tanstack-start-mastra-example --skill tanstack-router-ataschz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TanStack Router
Source: https://github.com/ataschz/tanstack-start-mastra-example/tree/main/.agents/skills/TanStack%20Router
Command: npx skills add https://github.com/ataschz/tanstack-start-mastra-example --skill tanstack-router-ataschz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to implement robust, type-safe, file-based routing in React applications using TanStack Router, covering route loaders, data fetching, and integration with TanStack Query to simplify state management and UI concerns.

Core Features & Use Cases

  • Type-safe, file-based routing for React SPAs with built-in route loaders and data shaping.
  • Seamless integration with TanStack Query for data fetching and caching.
  • Patterns for error boundaries, authentication guards, and progressive routing in real-world apps, including Vite plugin ordering and route not-found handling.

Quick Start

Install dependencies, configure the Vite plugin order as described in this skill, and run the development server to see a working example of file-based routes in a TanStack Router project.

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 file-based routing for a React SPA?

Type-safe file-based routing for a React SPA is configured using TanStack Router. It provides route loaders, data fetching, and error handling patterns while enforcing best practices for Vite plugin order and route guards.

How does TanStack Router integrate with TanStack Query for data fetching?

TanStack Router integrates with TanStack Query to manage data fetching and caching. This combination simplifies state management and UI concerns by synchronizing route loaders with query caches across typical SPA use cases.

What is the correct Vite plugin order for TanStack Router file-based routes?

The correct Vite plugin order is critical for file-based routes in a TanStack Router project. Enforcing the proper plugin sequence prevents common pitfalls and ensures route generation works correctly during development.

Can I use route guards for authentication in a React SPA with TanStack Router?

Route guards for authentication can be implemented in a React SPA using TanStack Router. It provides specific patterns for securing routes and handling progressive routing in real-world applications.

How do I handle not-found routes and error boundaries in TanStack Router?

Handling not-found routes and error boundaries in TanStack Router involves specific patterns for error handling. It ensures robust error management across typical SPA use cases by catching route-level exceptions.

Related Skills