router-core/navigation

Implement type-safe navigation with TanStack Router Link, useNavigate, and Navigate.

14.9k|1.8k|Updated Jan 14, 2019
One-click install
npx skills add https://github.com/TanStack/router --skill router-core-navigation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: router-core/navigation
Source: https://github.com/TanStack/router/tree/main/packages/router-core/skills/router-core/navigation
Command: npx skills add https://github.com/TanStack/router --skill router-core-navigation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Type-safe, predictable navigation is hard to manage across complex TanStack Router setups. This skill consolidates navigation primitives to reduce runtime errors and improve developer experience.

Core Features & Use Cases

  • Link component, useNavigate, and Navigate for both declarative and programmatic navigation with type safety
  • Relative navigation (from/to), scroll restoration, and preloading strategies
  • Helpers like linkOptions and createLink for reusable, type-checked navigation configurations

Quick Start

Create a simple Link to a route with params and render it in your app to confirm type-safe navigation.

Frequently Asked Questions about router-core/navigation

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

FAQPage Schema
How do I implement type-safe navigation in a TanStack Router React app?

Type-safe navigation in a TanStack Router React app is implemented using declarative Link components, programmatic useNavigate hooks, and Navigate primitives to ensure predictable routing and reduce runtime errors.

What is the best way to configure relative routing and preloading strategies with TanStack Router?

The best way to configure relative routing and preloading strategies is by using from/to relative options and built-in preloading primitives, which optimize route loading performance and user experience.

Does TanStack Router support programmatic navigation with active state styling and scroll restoration?

Yes, TanStack Router supports programmatic navigation alongside optional features like active state styling, scroll restoration, and route blocking to handle complex in-app navigation requirements.

Can I create reusable and type-checked navigation configurations for multiple links?

You can create reusable and type-checked navigation configurations by utilizing helper utilities like linkOptions and createLink to define predictable, shared routing setups across your application.

Why does type-safe navigation reduce runtime errors in complex React router setups?

Type-safe navigation reduces runtime errors by enforcing strict type validation on routing paths, links, and parameters during development, consolidating navigation primitives into a predictable structure.