react-router

Guides React Router development across Framework, Data, Declarative, and RSC modes.

Updated Sep 13, 2026
One-click install
npx skills add https://github.com/abdulazeezoj/monovella-poc --skill react-router-abdulazeezoj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router
Source: https://github.com/abdulazeezoj/monovella-poc/tree/main/.agents/skills/react-router
Command: npx skills add https://github.com/abdulazeezoj/monovella-poc --skill react-router-abdulazeezoj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React Router behaves differently depending on which mode an app uses, and applying Framework Mode patterns to a Declarative app (or vice versa) produces broken routing, loaders, and data flows. This Skill identifies the installed mode first, then loads the correct mode-specific guidance and version-matched documentation. ## Core Features & Use Cases - Mode Detection: Recognizes Framework, Data, Declarative, and unstable RSC modes from dependencies, config files, route conventions, and imports. - Mode-Specific References: Loads dedicated guidance for routing, loaders, actions, forms, fetchers, pending UI, SSR, pre-rendering, middleware, and type safety per mode. - Version-Matched Docs: Reads the markdown docs shipped inside node_modules/react-router/docs so advice matches the installed package version. - Use Case: When asked to add data loading to an app using createBrowserRouter, the Skill detects Data Mode and applies route-object loader/action patterns instead of Framework route-module conventions. ## Quick Start Ask the assistant to add a loader and form action to your React Router route, and it will detect your app's mode and apply the correct patterns.

Frequently Asked Questions about react-router

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add data loading to a React Router route?

In Framework and Data modes, define a loader function on the route and read its result in the component. In Framework Mode use generated Route types from ./+types; in Data Mode attach the loader to the route object. Declarative Mode has no loaders, so migrate to Data or Framework Mode first.

What is the difference between React Router Framework, Data, and Declarative modes?

Framework Mode uses the Vite plugin, app/routes.ts, and route modules with loaders and actions. Data Mode uses createBrowserRouter with route objects and RouterProvider. Declarative Mode uses BrowserRouter with JSX Routes and has no loaders, actions, or fetchers.

How do I migrate from Declarative to Data or Framework mode in React Router?

Read react-router/docs/start/modes.md plus the target mode's routing, data-loading, and actions docs, then replace JSX Routes with route objects or route modules. The Skill loads the migration doc index for Declarative-to-Data and Declarative/Data-to-Framework transitions.

Does React Router support React Server Components?

Yes, but RSC support is unstable and exists in two variants: RSC Framework Mode using unstable_reactRouterRSC with @vitejs/plugin-rsc, and RSC Data Mode using lower-level APIs like unstable_RSCRouteConfig. RSC routes use exports such as ServerComponent and ServerErrorBoundary.

When should I use Form versus useFetcher in React Router?

Use Form with method=get for search filters that update the URL, and method=post for mutations that change history or redirect. Use useFetcher or fetcher.Form for mutations that keep the user on the same page, and derive optimistic UI from fetcher.formData.

Why should I check the installed React Router docs instead of online guides?

React Router ships markdown docs inside node_modules/react-router/docs matched to the installed version, each tagged with a [MODES] marker. Applying docs from a different version or mode can introduce APIs or conventions your app does not support.