Skip to content
Skills Library
Programming · Building & coding

react-router-declarative-mode

/react-router-declarative-mode

Build React applications using React Router's declarative mode with BrowserRouter. Use when configuring routes with JSX, navigating with Link/NavLink, or reading URL params and search params without data loaders or actions.

Licence
MIT
Last repository change
18.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 18.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build React applications using React Router's declarative mode with BrowserRouter. Use when configuring routes with JSX, navigating with Link/NavLink, or reading URL params and search params without data loaders or actions.

Original author description

Build React applications using React Router's declarative mode with BrowserRouter. Use when configuring routes with JSX, navigating with Link/NavLink, or reading URL params and search params without data loaders or actions.

How it works

  1. When to Apply
  2. References
  3. Critical Patterns
  4. Further Documentation
Original SKILL.md headings · 122 lines, 366 words
SKILL.md preview
---
name: react-router-declarative-mode
description: Build React applications using React Router's declarative mode with BrowserRouter. Use when configuring routes with JSX, navigating with Link/NavLink, or reading URL params and search params without data loaders or actions.
license: MIT
---

# React Router Declarative Mode

Declarative mode is React Router's simplest mode using `<BrowserRouter>`, `<Routes>`, and `<Route>` for basic client-side routing without data loading features like loaders or actions.

## When to Apply

- Using `<BrowserRouter>` for routing
- Configuring routes with `<Routes>` and `<Route>`
- Navigating with `<Link>`, `<NavLink>`, or `useNavigate`
- Reading URL params with `useParams`
- Working with search params using `useSearchParams`
- Accessing location with `useLocation`

## References

Load the relevant reference for detailed guidance on the specific API/concept:

| Reference                  | Use When                                          |
| -------------------------- | ------------------------------------------------- |
| `references/routing.md`    | Configuring routes, nested routes, dynamic params |
| `references/navigation.md` | Links, NavLink active states, programmatic nav    |
| `references/url-values.md` | Reading params, search params, location           |

## Critical Patterns

These are the most important patterns to follow. Load the relevant reference for full details.

### Basic Route Setup

Configure routes with JSX using `<Routes>` and `<Route>`:

```tsx
import { BrowserRouter, Routes, Route } from "react-router";

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="about" element={<About />} />
        <Route path="dashboard" element={<Dashboard />}>
          <Route index element={<DashboardHome />} />
          <Route path="settings" element={<Settings />} />
        </Route>
        <Route path="users/:userId" element={<User />} />
      </Routes>
    </BrowserRouter>
  );
}
```

### NavLink Active States

Use `NavLink` for navigation with active styling:

```tsx
import { NavLink } from "react-router";

function Nav() {
  return (
    <nav>
      <NavLink
        to="/"
        end
        className={({ isActive }) => (isActive ? "active" : "")}
      >
        Home
      </NavLink>
      <NavLink
        to="/dashboard"
        className={({ isActive }) => (isActive ? "active" : "")}
      >
        Dashboard
      </NavLink>
    </nav>
  );
}
```

### Reading URL Params

Use `useParams` to read dynamic route segments:

```tsx
import { useParams } from "react-router";

function User() {
  const { userId } = useParams();
  return <h1>User {userId}</h1>;
}
```

### Working with Search Params

Use `useSearchParams` for query string values:

```tsx
import { useSearchParams } from "react-router";

function SearchResults() {
  const [searchParams, setSearchParams] = useSearchParams();
  const query = searchParams.get("q");

  return (
    <div>
      <input
        value={query || ""}
        onChange={(e) => setSearchParams({ q: e.target.value })}
      />
      <p>Results for: {query}</p>
    </div>
  );
}
```

## Further Documentation

If anything related to React Router is not covered in these references, you can search the official documentation:

https://reactrouter.com/docs
Files in this package (4)
  • SKILL.md 3 KB
  • references/navigation.md 7 KB
  • references/routing.md 6 KB
  • references/url-values.md 10 KB

Versions

The database has no other skills named react-router-declarative-mode.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version b6878ae5a5a1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100react-router-v7
    React Router v7 best practices for data-driven routing. Use when implementing routes, loaders, actions, Form components, fetchers, navigation guards, protected routes, or URL search params. Triggers on createBrowserRouter, RouterProvider, useLoaderData, useActionData, useFetcher, NavLink, Outlet.
  • 100react-router-framework-mode
    Build full-stack React applications using React Router's framework mode. Use when configuring routes, working with loaders and actions, handling forms, handling navigation, pending/optimistic UI, error boundaries, or working with react-router.config.ts or other react router conventions.
  • 100react-tanstack-router
    Use when implementing routing in a React app (NOT Next.js) with TanStack Router — file-based routes, loaders, search params.
  • 100react-router
    React Router v6+ for client-side routing. Covers BrowserRouter, Routes, navigation, data loading, nested routes, protected routes, and code splitting. USE WHEN: user mentions "React Router", "routing", "navigation", "BrowserRouter", "Routes", "useNavigate", "Link", "nested…
  • 100react-router-data-mode
    Build React applications using React Router's data mode with createBrowserRouter and RouterProvider. Use when working with route objects, loaders, actions, Form, useFetcher, or pending/optimistic UI without the Vite plugin.
  • 100tanstack-router
    Type-safe routing for React with file-based routes, validated search params, loaders, and automatic code splitting. Use when someone asks to "set up routing for React", "type-safe router", "TanStack Router", "file-based routing", "search params validation", "replace React Router…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.