Skip to main content

Welcome to React Router

React Router is a multi-strategy router for React that bridges the gap from React 18 to React 19. Use it maximally as a React framework or minimally as a library with your own architecture.

Three Ways to Use React Router

Choose the mode that fits your project:

Framework Mode

Full-stack framework with Vite integration, type generation, and SSR

Data Mode

Powerful data loading with loaders and actions using createBrowserRouter

Declarative Mode

Classic JSX-based routing with Routes and Route components

Key Features

Type Safety

Automatic type generation for route modules in Framework Mode with full TypeScript support

Data Loading

Load data before rendering with loaders and handle mutations with actions

Nested Routes

Compose complex UIs with nested routes and outlets for powerful layouts

SSR & SPA

Build server-rendered apps or client-only SPAs with the same API

File-based Routing

Automatic route generation from your file system structure

Optimistic UI

Build responsive UIs with pending states, fetchers, and optimistic updates

Why React Router?

React Router is the most popular and powerful routing library for React applications, trusted by companies worldwide.
  • Flexible: Start simple with declarative routes, add data loading when needed, or go full framework
  • Progressive: Upgrade from v6 to v7 gradually, or migrate from Remix seamlessly
  • Production-ready: Battle-tested in thousands of production applications
  • Modern: Built for React 18+ with support for React 19 features

Quick Comparison

FeatureFramework ModeData ModeDeclarative Mode
Type Generation
Data Loaders
File-based Routing
SSR Support⚠️ Manual⚠️ Manual
Build Tooling✅ Vite Plugin
ComplexityHighMediumLow

Get Started

Installation

Install React Router for your preferred mode

Quick Start

Build your first React Router app in minutes

Resources

GitHub

View the source code and contribute

Changelog

See what’s new in React Router

Upgrade from v6

Migrate your v6 application to v7

Upgrade from Remix

Transition from Remix to React Router

Build docs developers (and LLMs) love