Loading...
Loading...
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 skill4agent add remix-run/agent-skills react-router-framework-modeapp/routes.tsloaderclientLoaderactionclientAction<Link><NavLink><Form>redirectuseNavigatereact-router.config.ts| Reference | Use When |
|---|---|
| Configuring routes, nested routes, dynamic segments |
| Understanding all route module exports |
| Customizing root.tsx, adding global nav/footer, fonts |
| Loading data with loaders, streaming, caching |
| Handling forms, mutations, validation |
| Links, programmatic navigation, redirects |
| Loading states, optimistic UI |
| Error boundaries, error reporting |
| SSR vs SPA vs pre-rendering configuration |
| Adding middleware (requires v7.9.0+) |
| Cookie sessions, authentication, protected routes |
| Auto-generated route types, type imports, type safety |
npm list react-router| Feature | Minimum Version | Notes |
|---|---|---|
| Middleware | 7.9.0+ | Requires |
| Core framework features | 7.0.0+ | loaders, actions, Form, etc. |
<Form method="get">onSubmitsetSearchParams// ✅ Correct
<Form method="get">
<input name="q" />
</Form>
// ❌ Wrong - don't manually handle search params
<form onSubmit={(e) => { e.preventDefault(); setSearchParams(...) }}>useFetcher<Form>const fetcher = useFetcher();
const optimistic = fetcher.formData?.get("favorite") === "true" ?? isFavorite;
<fetcher.Form method="post" action={`/favorites/${id}`}>
<button>{optimistic ? "★" : "☆"}</button>
</fetcher.Form>;references/actions.mdroot.tsx// app/root.tsx - add navigation, footer, providers here
export default function App() {
return (
<div>
<nav>...</nav>
<Outlet />
<footer>...</footer>
</div>
);
}references/routing.mdmetaloaderDatadata// ✅ Correct
export function meta({ loaderData }: Route.MetaArgs) { ... }
// ❌ Wrong - `data` is deprecated
export function meta({ data }: Route.MetaArgs) { ... }references/route-modules.md