react-routing

Defines URL design and routing conventions for React applications.

1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/pnewsam/skills --skill react-routing-pnewsam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-routing
Source: https://github.com/pnewsam/skills/tree/main/archive/react-pilot/react-routing
Command: npx skills add https://github.com/pnewsam/skills --skill react-routing-pnewsam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React applications often end up with inconsistent URLs, view state trapped in component state, and scattered route definitions, making navigation hard to share, bookmark, or maintain. This Skill establishes clear principles for designing RESTful URLs, keeping navigational state in the URL, and structuring routes with a proper routing library. ## Core Features & Use Cases - RESTful URL conventions: Enforces kebab-case, plural-noun, noun-based URL patterns with shallow nesting for predictable route structure. - URL as source of truth: Guides use of route params for identity and search params for view configuration, avoiding duplicated state in useState. - Routing architecture patterns: Covers centralized route definitions, nested layouts with Outlet, route-level data loading, thin page components, protected routes, and 404 handling. - Use Case: When adding a new settings section to a React app, apply this Skill to decide the URL structure (/settings/notifications), wire it into the nested route config, and keep the active tab in search params so the view is shareable. ## Quick Start Ask the agent to design the URL structure and route configuration for a new invoices feature following the react-routing principles.

Frequently Asked Questions about react-routing

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

FAQPage Schema
How do I design URLs for a React application?▼

Design React URLs like a REST API: use plural nouns for collections (/invoices), kebab-case for multi-word segments (/line-items), and nouns instead of verbs (/invoices/new, not /create-invoice). Keep nesting shallow, rarely beyond three segments.

Should view state go in the URL or React state?▼

Navigational state that should survive a refresh or be shareable belongs in the URL. Use route params for resource identity and search params for view configuration like filters, sorting, and pagination, rather than copying values into useState.

React Router vs TanStack Router for a React SPA?▼

React Router v7 is the common default and merged the Remix data APIs, while TanStack Router differentiates with end-to-end type safety including typed paths, params, and validated search params. Default to the router the project already uses.

When should a modal or tab get its own URL?▼

Give a modal its own URL when it shows significant content, such as an invoice detail rendered over the list. Tabs deserve URLs when they represent distinct views, but not when they merely organize content within a single view.

How do I protect routes with authentication in React Router?▼

Handle authentication at the route level with a wrapper component or loader that redirects unauthenticated users to /login, rather than checking inside individual components. Store the intended destination in a redirect search param so users return after login.