You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+68-10Lines changed: 68 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,17 @@ order: 1
5
5
6
6
# React Router Home
7
7
8
-
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 minimally as a library with your own architecture.
8
+
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.
9
9
10
-
-[Getting Started - Framework](./start/framework/installation)
11
-
-[Getting Started - Library](./start/library/installation)
10
+
The router at the top of your app determines which features are available to the rest of the APIs. Each mode builds upon the previous to let you use as much or as little as you like.
12
11
13
-
If you are caught up on future flags, upgrading from React Router v6 or Remix is generally non-breaking:
12
+
-**Declarative**: minimalist usage, just URL matching, active states, and navigating. Classic and clean. If you're using `<BrowserRouter>`, you're using declarative routing.
13
+
-**Data**: Everything from declarative but adds data features like loaders, actions, and pending states. If you're using `createBrowserRouter`, you're using data.
14
+
-**Framework**: Let React Router do it all with efficient bundling, code splitting, server rendering, and advanced type safety. If you're using `routes.ts`, you're using the framework.
14
15
15
-
-[Upgrade from v6](./upgrading/v6)
16
-
-[Upgrade from Remix](./upgrading/remix)
16
+
## Declarative
17
17
18
-
## React Router as a Library
18
+
[Get Started](./start/library/installation) with Declarative routing.
19
19
20
20
Like previous versions, React Router can still be used as a simple, declarative routing library. Its only job will be matching the URL to a set of components, providing access to URL data, and navigating around the app.
[Get Started](./start/library/installation) with React Router as a library.
40
+
## Data
41
+
42
+
[Get Started](./start/library/installation) building a custom framework with a data router.
43
+
44
+
The framework features are built on top of lower-level APIs in React Router. You can use these APIs directly for a lighter-weight usage of React Router, but you'll need to set up your own bundling and server rendering (if you want it).
45
+
46
+
Some of the features include:
47
+
48
+
- Data loading with route loaders
49
+
- Data mutations with actions
50
+
- Concurrent mutations with fetchers
51
+
- Race condition handling
52
+
- Utilities to manage pending states
41
53
42
-
## React Router as a framework
54
+
Routes and loaders are configured at runtime with `createBrowserRouter`.
43
55
44
-
React Router can be used maximally as your React framework. In this setup, you'll use the React Router CLI and Vite bundler plugin for a full-stack development and deployment architecture. This enables React Router to provide a large set of features most web projects will want, including:
Using a data router, you now have access to nearly every runtime API in React Router.
92
+
93
+
## Framework
94
+
95
+
Building on top of the data mode, React Router can be used maximally as your React framework. In this setup, you'll use the React Router CLI and Vite bundler plugin for a full-stack development and deployment architecture. This enables React Router to provide a large set of features most web projects will want, including:
45
96
46
97
- Vite bundler and dev server integration
47
98
- hot module replacement
@@ -142,3 +193,10 @@ export async function action({
142
193
Route modules also provide conventions for SEO, asset loading, error boundaries, and more.
143
194
144
195
[Get Started](./start/framework/installation) with React Router as a framework.
196
+
197
+
## Upgrading
198
+
199
+
If you are caught up on future flags, upgrading from React Router v6 or Remix is generally non-breaking:
0 commit comments