# Table of Contents
- [React Router Home | React Router](#react-router-home-react-router)
- [React Router Home v7.6.0 | React Router](#react-router-home-v7-6-0-react-router)
- [Docs v6.30.0 | React Router](#docs-v6-30-0-react-router)
- [Picking a Mode | React Router](#picking-a-mode-react-router)
- [Installation | React Router](#installation-react-router)
- [Routing | React Router](#routing-react-router)
- [Route Module | React Router](#route-module-react-router)
- [Data Loading | React Router](#data-loading-react-router)
- [Rendering Strategies | React Router](#rendering-strategies-react-router)
- [Actions | React Router](#actions-react-router)
- [CHANGELOG.md | React Router](#changelog-md-react-router)
- [Navigating | React Router](#navigating-react-router)
- [Pending UI | React Router](#pending-ui-react-router)
- [React Router Home (dev branch) | React Router](#react-router-home-dev-branch-react-router)
- [Testing | React Router](#testing-react-router)
- [Deploying | React Router](#deploying-react-router)
- [Installation | React Router](#installation-react-router)
- [Routing | React Router](#routing-react-router)
- [CHANGELOG.md v7.6.0 | React Router](#changelog-md-v7-6-0-react-router)
- [Routing v7.6.0 | React Router](#routing-v7-6-0-react-router)
- [Tutorial v6.30.0 | React Router](#tutorial-v6-30-0-react-router)
- [Examples v6.30.0 | React Router](#examples-v6-30-0-react-router)
- [Navigating | React Router](#navigating-react-router)
- [Actions | React Router](#actions-react-router)
---
# React Router Home | React Router

[](/home)
latest
Branches
[latest (7.6.0)](/home)
[dev](/dev/)
Versions
[7.6.0](/7.6.0/home)
[6.30.0](/6.30.0)
[v4/5.x](https://v5.reactrouter.com/)
[v3.x](https://github.com/remix-run/react-router/tree/v3.2.6/docs)
[API Reference](https://api.reactrouter.com/v7/)
Search Light Dark System
[](https://github.com/remix-run/react-router "View code on GitHub")
[](https://rmx.as/discord "Chat on Discord")
React Router Home
[](#react-router-home)
React Router Home
========================================
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.
[](#getting-started)
Getting Started
------------------------------------
There are three primary ways, or "modes", to use it in your app, so there are three guides to get you started.
* [Declarative](./start/declarative/installation)
* [Data](./start/data/custom)
* [Framework](./start/framework/installation)
Learn which mode is right for you in [Picking a Mode](./start/modes)
.
[](#using-these-guides)
Using These Guides
------------------------------------------
Across the docs you'll see the following icons:
* [Framework](../../start/modes "Available with Framework")
* [Data](../../start/modes "Available with Data")
* [Declarative](../../start/modes "Available with Declarative")
These icons indicate which mode the content is relevant to.
Additional auto-generated reference documentation is available:
[Autogenerated Reference Docs ↗](https://api.reactrouter.com/v7/modules/react_router.html)
[](#upgrading)
Upgrading
------------------------
If you are caught up on future flags, upgrading from React Router v6 or Remix v2 is generally non-breaking. Remix v2 apps are encouraged to upgrade to React Router v7.
* [Upgrade from v6](./upgrading/v6)
* [Upgrade from Remix](./upgrading/remix)
[Brand Assets](/brand)
•
Docs and examples [CC 4.0](https://creativecommons.org/licenses/by/4.0/)
[Edit](https://github.com/remix-run/react-router/edit/main/docs/index.md)
---
# React Router Home v7.6.0 | React Router

[](/home)
7.6.0
Branches
[latest (7.6.0)](/home)
[dev](/dev/home)
Versions
[7.6.0](/7.6.0/home)
[6.30.0](/6.30.0)
[v4/5.x](https://v5.reactrouter.com/)
[v3.x](https://github.com/remix-run/react-router/tree/v3.2.6/docs)
[API Reference](https://api.reactrouter.com/v7/)
Search Light Dark System
[](https://github.com/remix-run/react-router "View code on GitHub")
[](https://rmx.as/discord "Chat on Discord")
React Router Home
[](#react-router-home)
React Router Home
========================================
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.
[](#getting-started)
Getting Started
------------------------------------
There are three primary ways, or "modes", to use it in your app, so there are three guides to get you started.
* [Declarative](./start/declarative/installation)
* [Data](./start/data/custom)
* [Framework](./start/framework/installation)
Learn which mode is right for you in [Picking a Mode](./start/modes)
.
[](#using-these-guides)
Using These Guides
------------------------------------------
Across the docs you'll see the following icons:
* [Framework](../../start/modes "Available with Framework")
* [Data](../../start/modes "Available with Data")
* [Declarative](../../start/modes "Available with Declarative")
These icons indicate which mode the content is relevant to.
Additional auto-generated reference documentation is available:
[Autogenerated Reference Docs ↗](https://api.reactrouter.com/v7/modules/react_router.html)
[](#upgrading)
Upgrading
------------------------
If you are caught up on future flags, upgrading from React Router v6 or Remix v2 is generally non-breaking. Remix v2 apps are encouraged to upgrade to React Router v7.
* [Upgrade from v6](./upgrading/v6)
* [Upgrade from Remix](./upgrading/remix)
[Brand Assets](/brand)
•
Docs and examples [CC 4.0](https://creativecommons.org/licenses/by/4.0/)
---
# Docs v6.30.0 | React Router

[](/home)
6.30.0
Branches
[latest (7.6.0)](/home)
[dev](/dev/)
Versions
[7.6.0](/7.6.0/home)
[6.30.0](/6.30.0)
[v4/5.x](https://v5.reactrouter.com/)
[v3.x](https://github.com/remix-run/react-router/tree/v3.2.6/docs)
Search Light Dark System
[](https://github.com/remix-run/react-router "View code on GitHub")
[](https://rmx.as/discord "Chat on Discord")
Navigation
[What's New in 6.4?\
------------------\
\
v6.4 is our most exciting release yet with new data abstractions for reads, writes, and navigation hooks to easily keep your UI in sync with your data. The new feature overview will catch you up.](/6.30.0/start/overview)
[I'm New!\
--------\
\
Start with the tutorial. It will quickly introduce you to the primary features of React Router: from configuring routes, to loading and mutating data, to pending and optimistic UI.](/6.30.0/start/tutorial)
[I'm on v5\
---------\
\
The migration guide will help you migrate incrementally and keep shipping along the way. Or, do it all in one yolo commit! Either way, we've got you covered to start using the new features right away.](/6.30.0/upgrading/v5)
[I'm Stuck!\
----------\
\
Running into a problem? Chances are you're not the first! Explore common questions about React Router v6.](/6.30.0/start/faq)
[Brand Assets](/brand)
•
Docs and examples [CC 4.0](https://creativecommons.org/licenses/by/4.0/)
---
# Picking a Mode | React Router

[](/home)
latest
Branches
[latest (7.6.0)](/start/modes)
[dev](/dev/start/modes)
Versions
[7.6.0](/7.6.0/home)
[6.30.0](/6.30.0)
[v4/5.x](https://v5.reactrouter.com/)
[v3.x](https://github.com/remix-run/react-router/tree/v3.2.6/docs)
[API Reference](https://api.reactrouter.com/v7/)
Search Light Dark System
[](https://github.com/remix-run/react-router "View code on GitHub")
[](https://rmx.as/discord "Chat on Discord")
Picking a Mode
[](#picking-a-mode)
Picking a Mode
==================================
React Router is a multi-strategy router for React. There are three primary ways, or "modes", to use it in your app. Across the docs you'll see these icons indicating which mode the content is relevant to:
* [Framework](../../start/modes "Available with Framework")
* [Data](../../start/modes "Available with Data")
* [Declarative](../../start/modes "Available with Declarative")
The features available in each mode are additive, so moving from Declarative to Data to Framework simply adds more features at the cost of architectural control. So pick your mode based on how much control or how much help you want from React Router.
The mode depends on which "top level" router API you're using:
**Declarative**
Declarative mode enables basic routing features like matching URLs to components, navigating around the app, and providing active states with APIs like ``, `useNavigate`, and `useLocation`.
import { BrowserRouter } from "react-router";
ReactDOM.createRoot(root).render(
I'm still using React Router after like 10 years.
Loader Data: {JSON.stringify(loaderData)}
Action Data: {JSON.stringify(actionData)}
Route Parameters: {JSON.stringify(params)}
Matched Routes: {JSON.stringify(matches)}
{description}
{description}
{description}
{description}
{actionData.title} updated
) : null}{actionData.title} updated
) : null}Message: {data.message};\
},\
loader() {\
return { message: "hello" };\
},\
},\
]);
render({data}
> ); } // Export an `ErrorBoundary` directly instead of needing to create a React Element from it export function ErrorBoundary() { let error = useRouteError(); return isRouteErrorResponse(error) ? (