Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
existential-birds avatar

React Router V7

  • 511 installs
  • 74 repo stars
  • Updated July 21, 2026
  • existential-birds/beagle

react-router-v7 is a Beagle agent skill that supplies current React Router v7 routing, loader, action, and navigation patterns for developers who need correct data-driven React apps without hunting migration guides.

About

react-router-v7 is a Beagle plugin skill from existential-birds/beagle with 435 skills.sh installs that encodes React Router v7 best practices for data-driven routing. It documents createBrowserRouter and RouterProvider setup, framework-mode routes.ts with the Vite plugin, nested routes with Outlet, dynamic and splat segments, and decision gates for Form versus useFetcher and loader versus useEffect. Triggers include createBrowserRouter, useLoaderData, useActionData, useFetcher, NavLink, and protected-route work. Four reference files—loaders.md, actions.md, navigation.md, and advanced.md—cover parallel loading, mutations, programmatic navigation, error boundaries, and lazy loading. A mode comparison table contrasts Framework, Data, and Declarative setups for SSR, type safety, and SPA control. Developers reach for react-router-v7 when migrating from React Router v6 or wiring loaders and actions in new React 19 full-stack apps.

  • Provides current React Router v7 routing, loaders, actions, and data APIs
  • Generates correct file-based routing and nested layout patterns
  • Handles v6-to-v7 migration differences automatically
  • Supplies ready-to-use component templates for common UX flows
  • Works inside Cursor, Claude Code, and Windsurf sessions

React Router V7 by the numbers

  • 511 all-time installs (skills.sh)
  • Ranked #618 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/existential-birds/beagle --skill react-router-v7

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs511
repo stars74
Last updatedJuly 21, 2026
Repositoryexistential-birds/beagle

How do you implement React Router v7 loaders and actions?

Get accurate, up-to-date React Router v7 patterns and component examples directly from an agent without hunting through migration guides.

Who is it for?

React developers implementing or migrating to React Router v7 data mode who want agent-guided routing decisions instead of outdated v6 examples.

Skip if: Teams on Next.js App Router, Remix-only stacks, or legacy React Router v5 declarative APIs without v7 data APIs.

When should I use this skill?

The user implements routes, loaders, actions, Form components, fetchers, navigation guards, protected routes, or URL search params with React Router v7.

What you get

React Router v7 route configs, loader and action handlers, Form or useFetcher mutations, and nested Outlet layouts following Beagle reference patterns.

  • Route configuration with loaders and actions
  • Form or useFetcher mutation handlers
  • Nested layout components with Outlet

By the numbers

  • 435 skills.sh installs listed in Beagle catalog metadata
  • Four reference markdown files for loaders, actions, navigation, and advanced topics
  • Three routing modes compared: Framework, Data, and Declarative

Files

SKILL.mdMarkdownGitHub ↗

React Router v7 Best Practices

Quick Reference

Router Setup (Data Mode):

import { createBrowserRouter, RouterProvider } from "react-router";

const router = createBrowserRouter([
  {
    path: "/",
    Component: Root,
    ErrorBoundary: RootErrorBoundary,
    loader: rootLoader,
    children: [
      { index: true, Component: Home },
      { path: "products/:productId", Component: Product, loader: productLoader },
    ],
  },
]);

ReactDOM.createRoot(root).render(<RouterProvider router={router} />);

Framework Mode (Vite plugin):

// routes.ts
import { index, route } from "@react-router/dev/routes";

export default [
  index("./home.tsx"),
  route("products/:pid", "./product.tsx"),
];

Route Configuration

Nested Routes with Outlets

createBrowserRouter([
  {
    path: "/dashboard",
    Component: Dashboard,
    children: [
      { index: true, Component: DashboardHome },
      { path: "settings", Component: Settings },
    ],
  },
]);

function Dashboard() {
  return (
    <div>
      <h1>Dashboard</h1>
      <Outlet /> {/* Renders child routes */}
    </div>
  );
}

Dynamic Segments and Splats

{ path: "teams/:teamId" }           // params.teamId
{ path: ":lang?/categories" }       // Optional segment
{ path: "files/*" }                 // Splat: params["*"]

Key Decision Points

Form vs Fetcher

Use `<Form>`: Creating/deleting with URL change, adding to history Use `useFetcher`: Inline updates, list operations, popovers - no URL change

Loader vs useEffect

Use loader: Data before render, server-side fetch, automatic revalidation Use useEffect: Client-only data, user-interaction dependent, subscriptions

Gates (decision sequencing)

Answer in order. Pass means the condition is true; pick the API on the same line and stop.

<Form> vs useFetcher

1. Must the URL or history stack change (bookmark/share, back returns to prior screen)?

  • Pass → <Form> / route action (or useSubmit + navigation). Stop.
  • Fail → Step 2.

2. Mutation stays on the same route (inline edit, modal, list row, no address change)?

  • Pass → useFetcher(). Stop.
  • Fail → Re-check step 1; you may need a dedicated action route or POST to the current URL.

loader vs useEffect

1. Is data needed for correct first render (or your intended <Suspense> boundary) for this route?

  • Pass → loader (Framework: clientLoader when appropriate). Stop.
  • Fail → Step 2.

2. Fetch only after mount from user action, timer, or subscription (not route entry)?

  • Pass → useEffect / event handlers. Stop.
  • Fail → Prefer loader + revalidation over an effect that mirrors navigation.

Additional Documentation

  • Data Loading: See references/loaders.md for loader patterns, parallel loading, search params
  • Mutations: See references/actions.md for actions, Form, fetchers, validation
  • Navigation: See references/navigation.md for Link, NavLink, programmatic nav
  • Advanced: See references/advanced.md for error boundaries, protected routes, lazy loading

Mode Comparison

FeatureFramework ModeData ModeDeclarative Mode
SetupVite plugincreateBrowserRouter<BrowserRouter>
Type SafetyAuto-generated typesManualManual
SSR SupportBuilt-inManualLimited
Use CaseFull-stack appsSPAs with controlSimple/legacy

Related skills

How it compares

Use react-router-v7 for v7-specific loader and action patterns; use general React skills when the stack is not React Router data mode.

FAQ

When should you use a loader instead of useEffect in react-router-v7?

react-router-v7 recommends route loaders when data is required for correct first render or SSR boundaries, and useEffect only for client-only fetches triggered after mount by user actions, timers, or subscriptions.

When should you use Form instead of useFetcher in react-router-v7?

react-router-v7 directs developers to Form or route actions when the URL or history stack must change for bookmarking or back navigation, and to useFetcher for inline mutations that stay on the same route.

What React Router v7 setup modes does react-router-v7 document?

react-router-v7 compares Framework Mode with the Vite plugin, Data Mode via createBrowserRouter, and Declarative Mode, noting built-in SSR and auto-generated types in Framework Mode versus manual control in Data Mode.

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.