tanstack-react-router_guide

Community

Secure authenticated routes with TanStack Router.

Authormathfalcon
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Authentication is a common requirement for web applications. This guide shows how to use TanStack Router to build protected routes and redirect users to login when they try to access them.

Core Features & Use Cases

  • Protected routes via route.beforeLoad to guard access and redirect unauthenticated users.
  • Redirect handling with login flow, including preserving the original destination for post-login navigation.
  • Router context integration to share authentication state across nested routes and layouts.
  • Support for non-redirected authentication flows where a login component is shown in place.

Quick Start

  1. Create a protected route with a beforeLoad function that checks authentication and redirects to /login if not authenticated.
  2. Use redirect({ to: '/login', search: { redirect: location.href } }) to return users after login.
  3. Wire an AuthProvider or React context to supply isAuthenticated state across routes.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: tanstack-react-router_guide
Download link: https://github.com/mathfalcon/revendiste/archive/main.zip#tanstack-react-router-guide

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.