Skip to content

Practical React Router v7 guidance covering data-driven routing, loaders, actions, and mutation choices.

CCM score
50 of 100
skills.sh installs
580
GitHub stars
91
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers route setup in data mode and framework mode, nested routes with Outlet, and dynamic, optional, and splat segments
  • Includes decision gates for choosing <Form> versus useFetcher and loader versus useEffect, plus links to references on loaders, actions, navigation, and advanced topics
  • Provides a mode comparison table covering framework, data, and declarative routers across setup, type safety, SSR support, and use case
  • Designed for React developers building SPAs or full-stack apps who need to pick the right routing and data-fetching API

Install

$ npx -y skills add existential-birds/beagle --skill react-router-v7 -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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):

// react-router.config.ts
import type { Config } from "@react-router/dev/config";

export default {
  ssr: true,
} satisfies Config;
// app/routes.ts
import { index, route, type RouteConfig } from "@react-router/dev/routes";

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

Route Configuration

Nested Routes with Outlets

Details

Repository
github.com/existential-birds/beagle
Category
Frontend & UI Code
First seen
Jun 3, 2026

More from existential-birds/beagle

All 37

Similar to React Router V7

More Frontend & UI Code