react-router

v2026.09.24

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.

GitHub
Install command
npx skhub add hairyf/react-router
Markdown
SKILL.md

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 -->
Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

MIT

Source path

skills/react-router

Default branch

main

Latest commit

4f463c7

Tree SHA

73bcd03