react-router

React Router - multi-strategy router for React bridging React 18 to React 19. Use when building React applications with routing, data loading, SSR, or SPA architectures.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "react-router" with this command: npx skills add hairyf/skills/hairyf-skills-react-router

React Router

The skill is based on React Router v7.13.0, generated at 2026-01-31.

React Router is a multi-strategy router for React bridging the gap from React 18 to React 19. You can use it maximally as a React framework or as minimally as you want. It supports three modes: Declarative (basic routing), Data (with loaders/actions), and Framework (full-featured with type safety and code splitting).

Core References

TopicDescriptionReference
ModesThree usage modes: Framework, Data, and Declarative - choosing the right approachcore-modes
RoutingRoute configuration, path patterns, nested routes, layout routes, and route matchingcore-routing
NavigationNavigation components and hooks: Link, NavLink, Form, useNavigate, redirectcore-navigation
Data LoadingLoading data with loaders and clientLoaders in route modulescore-data-loading
ActionsData mutations with actions and clientActions in route modulescore-actions
Route ModuleRoute module API: component, loader, action, error boundary, headers, meta, and morecore-route-module
HooksEssential React Router hooks: useNavigation, useLocation, useParams, useMatches, and morecore-hooks

Features

Data Management

TopicDescriptionReference
FetchersUsing fetchers for concurrent data interactions without navigationfeatures-fetchers
Error HandlingError boundaries, error handling, and error responsesfeatures-error-handling
MiddlewareMiddleware for authentication, logging, and request processingfeatures-middleware

Forms and User Input

TopicDescriptionReference
Form ValidationForm validation patterns, error handling, and user feedbackfeatures-form-validation
File UploadsHandling file uploads with multipart form data and file storagefeatures-file-uploads
Search ParamsWorking with URL search parameters using useSearchParams hookfeatures-search-params

Navigation and UX

TopicDescriptionReference
View TransitionsSmooth page transitions using View Transitions APIfeatures-view-transitions
Navigation BlockingBlocking navigation with useBlocker for unsaved form datafeatures-navigation-blocking

Best Practices

TopicDescriptionReference
Type SafetyType safety with Route types, automatic type inference, and type generationbest-practices-type-safety

Advanced

TopicDescriptionReference
StreamingStreaming with Suspense, deferring non-critical data, and React Suspense integrationadvanced-streaming
Pre-renderingPre-rendering static pages at build time for faster page loadsadvanced-pre-rendering
SPA ModeSingle Page App mode with SSR disabled and client-side routingadvanced-spa-mode

Key Recommendations

  • Choose the right mode: Use Framework mode for new projects, Data mode if you need control over bundling, Declarative mode for simple routing
  • Use Route Module API in Framework mode for automatic code splitting and type safety
  • Return promises from loaders for streaming with Suspense
  • Use fetchers for non-navigating form submissions and concurrent data loading
  • Export ErrorBoundary in route modules to catch errors gracefully
  • Use middleware for cross-cutting concerns like authentication and logging
  • Leverage type safety in Framework mode with generated Route types
  • Prefer declarative navigation (Link, NavLink, Form) over imperative (useNavigate)
<!-- Source references: - https://reactrouter.com/ - https://github.com/remix-run/react-router -->

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

tailwindcss

No summary provided by upstream source.

Repository SourceNeeds Review
752-hairyf
General

hairy-utils

No summary provided by upstream source.

Repository SourceNeeds Review
689-hairyf
General

react-use

No summary provided by upstream source.

Repository SourceNeeds Review
503-hairyf
General

motion

No summary provided by upstream source.

Repository SourceNeeds Review
487-hairyf