react-router-v7

Generate React Router v7 routing templates with loaders, actions, and nested routes.

75|9|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/anderskev/beagle --skill react-router-v7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router-v7
Source: https://github.com/anderskev/beagle/tree/main/skills/react-router-v7
Command: npx skills add https://github.com/anderskev/beagle --skill react-router-v7

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

React Router v7 enables data-driven routing with loaders, actions, fetchers, and URL params.

Core Features & Use Cases

  • Nested routes, loaders, actions, fetchers
  • Form and navigation pattern guidance
  • Protected routes, redirects, and error boundaries

Quick Start

Configure a router with a root loader and a child route that fetches data, then render with RouterProvider.

Frequently Asked Questions about react-router-v7

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

FAQPage Schema
How do I set up data-driven routing with loaders in React Router v7?

Data-driven routing with loaders fetches data before rendering routes. Define loaders on route objects, pass them to createBrowserRouter, access data with useLoaderData in components, and render with RouterProvider to enable automatic data fetching tied to navigation.

What's the difference between loaders and actions in React Router v7?

Loaders fetch data before a route renders, triggered on navigation. Actions handle form submissions and mutations, execute on form submit, and return data accessible via useActionData. Together they enable a complete data flow from navigation through user interaction.

How do I handle nested routes with outlets in React Router v7?

Nested routes create parent-child route hierarchies. Use Outlet in parent components to render child route content. Define loaders and actions at each level; child data flows independently while parent layout persists, enabling shared navigation and consistent page structure.

Can I protect routes and redirect unauthenticated users in React Router v7?

Protected routes use loaders to check authentication state before rendering. Return a redirect() from the loader if the user lacks permission, automatically sending them to login or a fallback page without rendering the protected component.

How do fetchers enable non-navigation form submissions in React Router v7?

Fetchers trigger actions without navigating away from the current route. Use useFetcher to submit forms, access response data with fetcher.data, and update UI optimistically while the action executes in the background, improving perceived responsiveness.

Does React Router v7 work with TypeScript and URL search parameters?

React Router v7 supports full TypeScript typing for loaders, actions, and route definitions. Access URL search params via useSearchParams hook to read and update query strings without navigation, enabling filtering, pagination, and state preservation in URLs.