This skill may not reflect the latest upstream change
Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.
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.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install remix-react-router-declarative-modeManual setup by platform
Claude Code
~/.claude/skills/remix-react-router-declarative-mode/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
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>, oruseNavigate - 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>:
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:
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:
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:
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
Security
Reviews (0)
More from Remix (Shopify)
View source →More Build skills
Browse category →Frequently asked questions about react-router-declarative-mode
What does the react-router-declarative-mode skill do?
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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the react-router-declarative-mode skill?
Run `npx @skills-hub-ai/cli install remix-react-router-declarative-mode` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/remix-react-router-declarative-mode/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does react-router-declarative-mode work with?
react-router-declarative-mode runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the react-router-declarative-mode skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use react-router-declarative-mode after installing it?
In Claude Code, type `/remix-react-router-declarative-mode` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the react-router-declarative-mode skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.