skills/react-router-framework-mode/SKILL.md
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.
npx skillsauth add remix-run/agent-skills react-router-framework-modeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Framework mode is React Router's full-stack development experience with file-based routing, server-side, client-side, and static rendering strategies, data loading and mutations, and type-safe route module API.
app/routes.ts)loader or clientLoaderaction or clientAction<Link>, <NavLink>, <Form>, redirect, and useNavigatereact-router.config.ts)Load the relevant reference for detailed guidance on the specific API/concept:
| Reference | Use When |
| ------------------------------------ | ----------------------------------------------------- |
| references/routing.md | Configuring routes, nested routes, dynamic segments |
| references/route-modules.md | Understanding all route module exports |
| references/special-files.md | Customizing root.tsx, adding global nav/footer, fonts |
| references/data-loading.md | Loading data with loaders, streaming, caching |
| references/actions.md | Handling forms, mutations, validation |
| references/navigation.md | Links, programmatic navigation, redirects |
| references/pending-ui.md | Loading states, optimistic UI |
| references/error-handling.md | Error boundaries, error reporting |
| references/rendering-strategies.md | SSR vs SPA vs pre-rendering configuration |
| references/middleware.md | Adding middleware (requires v7.9.0+) |
| references/sessions.md | Cookie sessions, authentication, protected routes |
| references/type-safety.md | Auto-generated route types, type imports, type safety |
Some features require specific React Router versions. Always verify before implementing:
npm list react-router
| Feature | Minimum Version | Notes |
| ----------------------- | --------------- | ----------------------------- |
| Middleware | 7.9.0+ | Requires v8_middleware flag |
| Core framework features | 7.0.0+ | loaders, actions, Form, etc. |
These are the most important patterns to follow. Load the relevant reference for full details.
Search forms - use <Form method="get">, NOT onSubmit with setSearchParams:
// ✅ Correct
<Form method="get">
<input name="q" />
</Form>
// ❌ Wrong - don't manually handle search params
<form onSubmit={(e) => { e.preventDefault(); setSearchParams(...) }}>
Inline mutations - use useFetcher, NOT <Form> (which causes page navigation):
const fetcher = useFetcher();
const optimistic = fetcher.formData?.get("favorite") === "true" ?? isFavorite;
<fetcher.Form method="post" action={`/favorites/${id}`}>
<button>{optimistic ? "★" : "☆"}</button>
</fetcher.Form>;
See references/actions.md for complete patterns.
Global UI belongs in root.tsx - don't create separate layout files for nav/footer:
// app/root.tsx - add navigation, footer, providers here
export default function App() {
return (
<div>
<nav>...</nav>
<Outlet />
<footer>...</footer>
</div>
);
}
Use nested routes for section-specific layouts. See references/routing.md.
meta uses loaderData, not deprecated data:
// ✅ Correct
export function meta({ loaderData }: Route.MetaArgs) { ... }
// ❌ Wrong - `data` is deprecated
export function meta({ data }: Route.MetaArgs) { ... }
See references/route-modules.md for all exports.
If anything related to React Router is not covered in these references, you can search the official documentation:
https://reactrouter.com/docs
development
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.
tools
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.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.