UNPKG

48.8 kBMarkdownView Raw
1# `react-router`
2
3## 7.1.1
4
5## 7.1.0
6
7### Patch Changes
8
9- Throw unwrapped single fetch redirect to align with pre-single fetch behavior ([#12506](https://github.com/remix-run/react-router/pull/12506))
10- Ignore redirects when inferring loader data types ([#12527](https://github.com/remix-run/react-router/pull/12527))
11- Remove `<Link prefetch>` warning which suffers from false positives in a lazy route discovery world ([#12485](https://github.com/remix-run/react-router/pull/12485))
12
13## 7.0.2
14
15### Patch Changes
16
17- temporarily only use one build in export map so packages can have a peer dependency on react router ([#12437](https://github.com/remix-run/react-router/pull/12437))
18- Generate wide `matches` and `params` types for current route and child routes ([#12397](https://github.com/remix-run/react-router/pull/12397))
19
20 At runtime, `matches` includes child route matches and `params` include child route path parameters.
21 But previously, we only generated types for parent routes in `matches`; for `params`, we only considered the parent routes and the current route.
22 To align our generated types more closely to the runtime behavior, we now generate more permissive, wider types when accessing child route information.
23
24## 7.0.1
25
26## 7.0.0
27
28### Major Changes
29
30- Remove the original `defer` implementation in favor of using raw promises via single fetch and `turbo-stream`. This removes these exports from React Router: ([#11744](https://github.com/remix-run/react-router/pull/11744))
31
32 - `defer`
33 - `AbortedDeferredError`
34 - `type TypedDeferredData`
35 - `UNSAFE_DeferredData`
36 - `UNSAFE_DEFERRED_SYMBOL`,
37
38- - Collapse `@remix-run/router` into `react-router` ([#11505](https://github.com/remix-run/react-router/pull/11505))
39 - Collapse `react-router-dom` into `react-router`
40 - Collapse `@remix-run/server-runtime` into `react-router`
41 - Collapse `@remix-run/testing` into `react-router`
42
43- Remove single\_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
44
45- Drop support for Node 16, React Router SSR now requires Node 18 or higher ([#11391](https://github.com/remix-run/react-router/pull/11391))
46
47- Remove `future.v7_startTransition` flag ([#11696](https://github.com/remix-run/react-router/pull/11696))
48
49- - Expose the underlying router promises from the following APIs for compsition in React 19 APIs: ([#11521](https://github.com/remix-run/react-router/pull/11521))
50 - `useNavigate()`
51 - `useSubmit`
52 - `useFetcher().load`
53 - `useFetcher().submit`
54 - `useRevalidator.revalidate`
55
56- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
57
58- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
59
60 - `createCookie`
61 - `createCookieSessionStorage`
62 - `createMemorySessionStorage`
63 - `createSessionStorage`
64
65 For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
66
67 Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
68
69 - `createCookieFactory`
70 - `createSessionStorageFactory`
71 - `createCookieSessionStorageFactory`
72 - `createMemorySessionStorageFactory`
73
74- Imports/Exports cleanup ([#11840](https://github.com/remix-run/react-router/pull/11840))
75
76 - Removed the following exports that were previously public API from `@remix-run/router`
77 - types
78 - `AgnosticDataIndexRouteObject`
79 - `AgnosticDataNonIndexRouteObject`
80 - `AgnosticDataRouteMatch`
81 - `AgnosticDataRouteObject`
82 - `AgnosticIndexRouteObject`
83 - `AgnosticNonIndexRouteObject`
84 - `AgnosticRouteMatch`
85 - `AgnosticRouteObject`
86 - `TrackedPromise`
87 - `unstable_AgnosticPatchRoutesOnMissFunction`
88 - `Action` -> exported as `NavigationType` via `react-router`
89 - `Router` exported as `DataRouter` to differentiate from RR's `<Router>`
90 - API
91 - `getToPathname` (`@private`)
92 - `joinPaths` (`@private`)
93 - `normalizePathname` (`@private`)
94 - `resolveTo` (`@private`)
95 - `stripBasename` (`@private`)
96 - `createBrowserHistory` -> in favor of `createBrowserRouter`
97 - `createHashHistory` -> in favor of `createHashRouter`
98 - `createMemoryHistory` -> in favor of `createMemoryRouter`
99 - `createRouter`
100 - `createStaticHandler` -> in favor of wrapper `createStaticHandler` in RR Dom
101 - `getStaticContextFromError`
102 - Removed the following exports that were previously public API from `react-router`
103 - `Hash`
104 - `Pathname`
105 - `Search`
106
107- update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))
108
109- Remove `future.v7_prependBasename` from the ionternalized `@remix-run/router` package ([#11726](https://github.com/remix-run/react-router/pull/11726))
110
111- Migrate Remix type generics to React Router ([#12180](https://github.com/remix-run/react-router/pull/12180))
112
113 - These generics are provided for Remix v2 migration purposes
114 - These generics and the APIs they exist on should be considered informally deprecated in favor of the new `Route.*` types
115 - Anyone migrating from React Router v6 should probably not leverage these new generics and should migrate straight to the `Route.*` types
116 - For React Router v6 users, these generics are new and should not impact your app, with one exception
117 - `useFetcher` previously had an optional generic (used primarily by Remix v2) that expected the data type
118 - This has been updated in v7 to expect the type of the function that generates the data (i.e., `typeof loader`/`typeof action`)
119 - Therefore, you should update your usages:
120 - `useFetcher<LoaderData>()`
121 - `useFetcher<typeof loader>()`
122
123- Remove `future.v7_throwAbortReason` from internalized `@remix-run/router` package ([#11728](https://github.com/remix-run/react-router/pull/11728))
124
125- Add `exports` field to all packages ([#11675](https://github.com/remix-run/react-router/pull/11675))
126
127- node package no longer re-exports from react-router ([#11702](https://github.com/remix-run/react-router/pull/11702))
128
129- renamed RemixContext to FrameworkContext ([#11705](https://github.com/remix-run/react-router/pull/11705))
130
131- updates the minimum React version to 18 ([#11689](https://github.com/remix-run/react-router/pull/11689))
132
133- PrefetchPageDescriptor replaced by PageLinkDescriptor ([#11960](https://github.com/remix-run/react-router/pull/11960))
134
135- - Consolidate types previously duplicated across `@remix-run/router`, `@remix-run/server-runtime`, and `@remix-run/react` now that they all live in `react-router` ([#12177](https://github.com/remix-run/react-router/pull/12177))
136 - Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
137 - The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
138 - `Record<string, Route> -> Record<string, Route | undefined>`
139 - Removed `AppData` type in favor of inlining `unknown` in the few locations it was used
140 - Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
141
142- - Remove the `future.v7_partialHydration` flag ([#11725](https://github.com/remix-run/react-router/pull/11725))
143 - This also removes the `<RouterProvider fallbackElement>` prop
144 - To migrate, move the `fallbackElement` to a `hydrateFallbackElement`/`HydrateFallback` on your root route
145 - Also worth nothing there is a related breaking changer with this future flag:
146 - Without `future.v7_partialHydration` (when using `fallbackElement`), `state.navigation` was populated during the initial load
147 - With `future.v7_partialHydration`, `state.navigation` remains in an `"idle"` state during the initial load
148
149- Remove `v7_relativeSplatPath` future flag ([#11695](https://github.com/remix-run/react-router/pull/11695))
150
151- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
152
153 - Remove `installGlobals()` as this should no longer be necessary
154
155- Remove remaining future flags ([#11820](https://github.com/remix-run/react-router/pull/11820))
156
157 - React Router `v7_skipActionErrorRevalidation`
158 - Remix `v3_fetcherPersist`, `v3_relativeSplatPath`, `v3_throwAbortReason`
159
160- rename createRemixStub to createRoutesStub ([#11692](https://github.com/remix-run/react-router/pull/11692))
161
162- Remove `@remix-run/router` deprecated `detectErrorBoundary` option in favor of `mapRouteProperties` ([#11751](https://github.com/remix-run/react-router/pull/11751))
163
164- Add `react-router/dom` subpath export to properly enable `react-dom` as an optional `peerDependency` ([#11851](https://github.com/remix-run/react-router/pull/11851))
165
166 - This ensures that we don't blindly `import ReactDOM from "react-dom"` in `<RouterProvider>` in order to access `ReactDOM.flushSync()`, since that would break `createMemoryRouter` use cases in non-DOM environments
167 - DOM environments should import from `react-router/dom` to get the proper component that makes `ReactDOM.flushSync()` available:
168 - If you are using the Vite plugin, use this in your `entry.client.tsx`:
169 - `import { HydratedRouter } from 'react-router/dom'`
170 - If you are not using the Vite plugin and are manually calling `createBrowserRouter`/`createHashRouter`:
171 - `import { RouterProvider } from "react-router/dom"`
172
173- Remove `future.v7_fetcherPersist` flag ([#11731](https://github.com/remix-run/react-router/pull/11731))
174
175- Update `cookie` dependency to `^1.0.1` - please see the [release notes](https://github.com/jshttp/cookie/releases) for any breaking changes ([#12172](https://github.com/remix-run/react-router/pull/12172))
176
177### Minor Changes
178
179- - Add support for `prerender` config in the React Router vite plugin, to support existing SSG use-cases ([#11539](https://github.com/remix-run/react-router/pull/11539))
180 - You can use the `prerender` config to pre-render your `.html` and `.data` files at build time and then serve them statically at runtime (either from a running server or a CDN)
181 - `prerender` can either be an array of string paths, or a function (sync or async) that returns an array of strings so that you can dynamically generate the paths by talking to your CMS, etc.
182
183 ```ts
184 // react-router.config.ts
185 import type { Config } from "@react-router/dev/config";
186
187 export default {
188 async prerender() {
189 let slugs = await fakeGetSlugsFromCms();
190 // Prerender these paths into `.html` files at build time, and `.data`
191 // files if they have loaders
192 return ["/", "/about", ...slugs.map((slug) => `/product/${slug}`)];
193 },
194 } satisfies Config;
195
196 async function fakeGetSlugsFromCms() {
197 await new Promise((r) => setTimeout(r, 1000));
198 return ["shirt", "hat"];
199 }
200 ```
201
202- Params, loader data, and action data as props for route component exports ([#11961](https://github.com/remix-run/react-router/pull/11961))
203
204 ```tsx
205 export default function Component({ params, loaderData, actionData }) {}
206
207 export function HydrateFallback({ params }) {}
208 export function ErrorBoundary({ params, loaderData, actionData }) {}
209 ```
210
211- Remove duplicate `RouterProvider` impliementations ([#11679](https://github.com/remix-run/react-router/pull/11679))
212
213- ### Typesafety improvements ([#12019](https://github.com/remix-run/react-router/pull/12019))
214
215 React Router now generates types for each of your route modules.
216 You can access those types by importing them from `./+types.<route filename without extension>`.
217 For example:
218
219 ```ts
220 // app/routes/product.tsx
221 import type * as Route from "./+types.product";
222
223 export function loader({ params }: Route.LoaderArgs) {}
224
225 export default function Component({ loaderData }: Route.ComponentProps) {}
226 ```
227
228 This initial implementation targets type inference for:
229
230 - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
231 - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
232 - `ActionData` : Action data from `action` and/or `clientAction` within your route module
233
234 In the future, we plan to add types for the rest of the route module exports: `meta`, `links`, `headers`, `shouldRevalidate`, etc.
235 We also plan to generate types for typesafe `Link`s:
236
237 ```tsx
238 <Link to="/products/:id" params={{ id: 1 }} />
239 // ^^^^^^^^^^^^^ ^^^^^^^^^
240 // typesafe `to` and `params` based on the available routes in your app
241 ```
242
243 Check out our docs for more:
244
245 - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
246 - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
247
248- Stabilize `unstable_dataStrategy` ([#11969](https://github.com/remix-run/react-router/pull/11969))
249
250- Stabilize `unstable_patchRoutesOnNavigation` ([#11970](https://github.com/remix-run/react-router/pull/11970))
251
252### Patch Changes
253
254- No changes ([`506329c4e`](https://github.com/remix-run/react-router/commit/506329c4e2e7aba9837cbfa44df6103b49423745))
255
256- chore: re-enable development warnings through a `development` exports condition. ([#12269](https://github.com/remix-run/react-router/pull/12269))
257
258- Remove unstable upload handler. ([#12015](https://github.com/remix-run/react-router/pull/12015))
259
260- Remove unneeded dependency on @web3-storage/multipart-parser ([#12274](https://github.com/remix-run/react-router/pull/12274))
261
262- Fix redirects returned from loaders/actions using `data()` ([#12021](https://github.com/remix-run/react-router/pull/12021))
263
264- fix(react-router): (v7) fix static prerender of non-ascii characters ([#12161](https://github.com/remix-run/react-router/pull/12161))
265
266- Replace `substr` with `substring` ([#12080](https://github.com/remix-run/react-router/pull/12080))
267
268- Remove the deprecated `json` utility ([#12146](https://github.com/remix-run/react-router/pull/12146))
269
270 - You can use [`Response.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json_static) if you still need to construct JSON responses in your app
271
272- Remove unneeded dependency on source-map ([#12275](https://github.com/remix-run/react-router/pull/12275))
273
274## 6.28.0
275
276### Minor Changes
277
278- - Log deprecation warnings for v7 flags ([#11750](https://github.com/remix-run/react-router/pull/11750))
279 - Add deprecation warnings to `json`/`defer` in favor of returning raw objects
280 - These methods will be removed in React Router v7
281
282### Patch Changes
283
284- Update JSDoc URLs for new website structure (add /v6/ segment) ([#12141](https://github.com/remix-run/react-router/pull/12141))
285- Updated dependencies:
286 - `@remix-run/router@1.21.0`
287
288## 6.27.0
289
290### Minor Changes
291
292- Stabilize `unstable_patchRoutesOnNavigation` ([#11973](https://github.com/remix-run/react-router/pull/11973))
293 - Add new `PatchRoutesOnNavigationFunctionArgs` type for convenience ([#11967](https://github.com/remix-run/react-router/pull/11967))
294- Stabilize `unstable_dataStrategy` ([#11974](https://github.com/remix-run/react-router/pull/11974))
295- Stabilize the `unstable_flushSync` option for navigations and fetchers ([#11989](https://github.com/remix-run/react-router/pull/11989))
296- Stabilize the `unstable_viewTransition` option for navigations and the corresponding `unstable_useViewTransitionState` hook ([#11989](https://github.com/remix-run/react-router/pull/11989))
297
298### Patch Changes
299
300- Fix bug when submitting to the current contextual route (parent route with an index child) when an `?index` param already exists from a prior submission ([#12003](https://github.com/remix-run/react-router/pull/12003))
301
302- Fix `useFormAction` bug - when removing `?index` param it would not keep other non-Remix `index` params ([#12003](https://github.com/remix-run/react-router/pull/12003))
303
304- Fix types for `RouteObject` within `PatchRoutesOnNavigationFunction`'s `patch` method so it doesn't expect agnostic route objects passed to `patch` ([#11967](https://github.com/remix-run/react-router/pull/11967))
305
306- Updated dependencies:
307 - `@remix-run/router@1.20.0`
308
309## 6.26.2
310
311### Patch Changes
312
313- Updated dependencies:
314 - `@remix-run/router@1.19.2`
315
316## 6.26.1
317
318### Patch Changes
319
320- Rename `unstable_patchRoutesOnMiss` to `unstable_patchRoutesOnNavigation` to match new behavior ([#11888](https://github.com/remix-run/react-router/pull/11888))
321- Updated dependencies:
322 - `@remix-run/router@1.19.1`
323
324## 6.26.0
325
326### Minor Changes
327
328- Add a new `replace(url, init?)` alternative to `redirect(url, init?)` that performs a `history.replaceState` instead of a `history.pushState` on client-side navigation redirects ([#11811](https://github.com/remix-run/react-router/pull/11811))
329
330### Patch Changes
331
332- Fix initial hydration behavior when using `future.v7_partialHydration` along with `unstable_patchRoutesOnMiss` ([#11838](https://github.com/remix-run/react-router/pull/11838))
333 - During initial hydration, `router.state.matches` will now include any partial matches so that we can render ancestor `HydrateFallback` components
334- Updated dependencies:
335 - `@remix-run/router@1.19.0`
336
337## 6.25.1
338
339No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md) for an overview of all changes in v6.25.1.
340
341## 6.25.0
342
343### Minor Changes
344
345- Stabilize `future.unstable_skipActionErrorRevalidation` as `future.v7_skipActionErrorRevalidation` ([#11769](https://github.com/remix-run/react-router/pull/11769))
346 - When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a `Response` with a `4xx`/`5xx` status code
347 - You may still opt-into revalidation via `shouldRevalidate`
348 - This also changes `shouldRevalidate`'s `unstable_actionStatus` parameter to `actionStatus`
349
350### Patch Changes
351
352- Fix regression and properly decode paths inside `useMatch` so matches/params reflect decoded params ([#11789](https://github.com/remix-run/react-router/pull/11789))
353- Updated dependencies:
354 - `@remix-run/router@1.18.0`
355
356## 6.24.1
357
358### Patch Changes
359
360- When using `future.v7_relativeSplatPath`, properly resolve relative paths in splat routes that are children of pathless routes ([#11633](https://github.com/remix-run/react-router/pull/11633))
361- Updated dependencies:
362 - `@remix-run/router@1.17.1`
363
364## 6.24.0
365
366### Minor Changes
367
368- Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626))
369 - RFC: <https://github.com/remix-run/react-router/discussions/11113>
370 - `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/v6/routers/create-browser-router>
371
372### Patch Changes
373
374- Updated dependencies:
375 - `@remix-run/router@1.17.0`
376
377## 6.23.1
378
379### Patch Changes
380
381- allow undefined to be resolved with `<Await>` ([#11513](https://github.com/remix-run/react-router/pull/11513))
382- Updated dependencies:
383 - `@remix-run/router@1.16.1`
384
385## 6.23.0
386
387### Minor Changes
388
389- Add a new `unstable_dataStrategy` configuration option ([#11098](https://github.com/remix-run/react-router/pull/11098))
390 - This option allows Data Router applications to take control over the approach for executing route loaders and actions
391 - The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix single-fetch, middleware/context APIs, automatic loader caching, and more
392
393### Patch Changes
394
395- Updated dependencies:
396 - `@remix-run/router@1.16.0`
397
398## 6.22.3
399
400### Patch Changes
401
402- Updated dependencies:
403 - `@remix-run/router@1.15.3`
404
405## 6.22.2
406
407### Patch Changes
408
409- Updated dependencies:
410 - `@remix-run/router@1.15.2`
411
412## 6.22.1
413
414### Patch Changes
415
416- Fix encoding/decoding issues with pre-encoded dynamic parameter values ([#11199](https://github.com/remix-run/react-router/pull/11199))
417- Updated dependencies:
418 - `@remix-run/router@1.15.1`
419
420## 6.22.0
421
422### Patch Changes
423
424- Updated dependencies:
425 - `@remix-run/router@1.15.0`
426
427## 6.21.3
428
429### Patch Changes
430
431- Remove leftover `unstable_` prefix from `Blocker`/`BlockerFunction` types ([#11187](https://github.com/remix-run/react-router/pull/11187))
432
433## 6.21.2
434
435### Patch Changes
436
437- Updated dependencies:
438 - `@remix-run/router@1.14.2`
439
440## 6.21.1
441
442### Patch Changes
443
444- Fix bug with `route.lazy` not working correctly on initial SPA load when `v7_partialHydration` is specified ([#11121](https://github.com/remix-run/react-router/pull/11121))
445- Updated dependencies:
446 - `@remix-run/router@1.14.1`
447
448## 6.21.0
449
450### Minor Changes
451
452- Add a new `future.v7_relativeSplatPath` flag to implement a breaking bug fix to relative routing when inside a splat route. ([#11087](https://github.com/remix-run/react-router/pull/11087))
453
454 This fix was originally added in [#10983](https://github.com/remix-run/react-router/issues/10983) and was later reverted in [#11078](https://github.com/remix-run/react-router/pull/11078) because it was determined that a large number of existing applications were relying on the buggy behavior (see [#11052](https://github.com/remix-run/react-router/issues/11052))
455
456 **The Bug**
457 The buggy behavior is that without this flag, the default behavior when resolving relative paths is to _ignore_ any splat (`*`) portion of the current route path.
458
459 **The Background**
460 This decision was originally made thinking that it would make the concept of nested different sections of your apps in `<Routes>` easier if relative routing would _replace_ the current splat:
461
462 ```jsx
463 <BrowserRouter>
464 <Routes>
465 <Route path="/" element={<Home />} />
466 <Route path="dashboard/*" element={<Dashboard />} />
467 </Routes>
468 </BrowserRouter>
469 ```
470
471 Any paths like `/dashboard`, `/dashboard/team`, `/dashboard/projects` will match the `Dashboard` route. The dashboard component itself can then render nested `<Routes>`:
472
473 ```jsx
474 function Dashboard() {
475 return (
476 <div>
477 <h2>Dashboard</h2>
478 <nav>
479 <Link to="/">Dashboard Home</Link>
480 <Link to="team">Team</Link>
481 <Link to="projects">Projects</Link>
482 </nav>
483
484 <Routes>
485 <Route path="/" element={<DashboardHome />} />
486 <Route path="team" element={<DashboardTeam />} />
487 <Route path="projects" element={<DashboardProjects />} />
488 </Routes>
489 </div>
490 );
491 }
492 ```
493
494 Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the `Dashboard` as its own independent app, or embed it into your large app without making any changes to it.
495
496 **The Problem**
497
498 The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that `"."` always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using `"."`:
499
500 ```jsx
501 // If we are on URL /dashboard/team, and we want to link to /dashboard/team:
502 function DashboardTeam() {
503 // ❌ This is broken and results in <a href="/dashboard">
504 return <Link to=".">A broken link to the Current URL</Link>;
505
506 // ✅ This is fixed but super unintuitive since we're already at /dashboard/team!
507 return <Link to="./team">A broken link to the Current URL</Link>;
508 }
509 ```
510
511 We've also introduced an issue that we can no longer move our `DashboardTeam` component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as `/dashboard/:widget`. Now, our `"."` links will, properly point to ourself _inclusive of the dynamic param value_ so behavior will break from it's corresponding usage in a `/dashboard/*` route.
512
513 Even worse, consider a nested splat route configuration:
514
515 ```jsx
516 <BrowserRouter>
517 <Routes>
518 <Route path="dashboard">
519 <Route path="*" element={<Dashboard />} />
520 </Route>
521 </Routes>
522 </BrowserRouter>
523 ```
524
525 Now, a `<Link to=".">` and a `<Link to="..">` inside the `Dashboard` component go to the same place! That is definitely not correct!
526
527 Another common issue arose in Data Routers (and Remix) where any `<Form>` should post to it's own route `action` if you the user doesn't specify a form action:
528
529 ```jsx
530 let router = createBrowserRouter({
531 path: "/dashboard",
532 children: [
533 {
534 path: "*",
535 action: dashboardAction,
536 Component() {
537 // ❌ This form is broken! It throws a 405 error when it submits because
538 // it tries to submit to /dashboard (without the splat value) and the parent
539 // `/dashboard` route doesn't have an action
540 return <Form method="post">...</Form>;
541 },
542 },
543 ],
544 });
545 ```
546
547 This is just a compounded issue from the above because the default location for a `Form` to submit to is itself (`"."`) - and if we ignore the splat portion, that now resolves to the parent route.
548
549 **The Solution**
550 If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage `../` for any links to "sibling" pages:
551
552 ```jsx
553 <BrowserRouter>
554 <Routes>
555 <Route path="dashboard">
556 <Route index path="*" element={<Dashboard />} />
557 </Route>
558 </Routes>
559 </BrowserRouter>
560
561 function Dashboard() {
562 return (
563 <div>
564 <h2>Dashboard</h2>
565 <nav>
566 <Link to="..">Dashboard Home</Link>
567 <Link to="../team">Team</Link>
568 <Link to="../projects">Projects</Link>
569 </nav>
570
571 <Routes>
572 <Route path="/" element={<DashboardHome />} />
573 <Route path="team" element={<DashboardTeam />} />
574 <Route path="projects" element={<DashboardProjects />} />
575 </Router>
576 </div>
577 );
578 }
579 ```
580
581 This way, `.` means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and `..` always means "my parents pathname".
582
583### Patch Changes
584
585- Properly handle falsy error values in ErrorBoundary's ([#11071](https://github.com/remix-run/react-router/pull/11071))
586- Updated dependencies:
587 - `@remix-run/router@1.14.0`
588
589## 6.20.1
590
591### Patch Changes
592
593- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see <https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329>). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
594- Updated dependencies:
595 - `@remix-run/router@1.13.1`
596
597## 6.20.0
598
599### Minor Changes
600
601- Export the `PathParam` type from the public API ([#10719](https://github.com/remix-run/react-router/pull/10719))
602
603### Patch Changes
604
605- Fix bug with `resolveTo` in splat routes ([#11045](https://github.com/remix-run/react-router/pull/11045))
606 - This is a follow up to [#10983](https://github.com/remix-run/react-router/pull/10983) to handle the few other code paths using `getPathContributingMatches`
607 - This removes the `UNSAFE_getPathContributingMatches` export from `@remix-run/router` since we no longer need this in the `react-router`/`react-router-dom` layers
608- Updated dependencies:
609 - `@remix-run/router@1.13.0`
610
611## 6.19.0
612
613### Minor Changes
614
615- Add `unstable_flushSync` option to `useNavigate`/`useSumbit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005))
616- Remove the `unstable_` prefix from the [`useBlocker`](https://reactrouter.com/v6/hooks/use-blocker) hook as it's been in use for enough time that we are confident in the API. We do not plan to remove the prefix from `unstable_usePrompt` due to differences in how browsers handle `window.confirm` that prevent React Router from guaranteeing consistent/correct behavior. ([#10991](https://github.com/remix-run/react-router/pull/10991))
617
618### Patch Changes
619
620- Fix `useActionData` so it returns proper contextual action data and not _any_ action data in the tree ([#11023](https://github.com/remix-run/react-router/pull/11023))
621
622- Fix bug in `useResolvedPath` that would cause `useResolvedPath(".")` in a splat route to lose the splat portion of the URL path. ([#10983](https://github.com/remix-run/react-router/pull/10983))
623
624 - ⚠️ This fixes a quite long-standing bug specifically for `"."` paths inside a splat route which incorrectly dropped the splat portion of the URL. If you are relative routing via `"."` inside a splat route in your application you should double check that your logic is not relying on this buggy behavior and update accordingly.
625
626- Updated dependencies:
627 - `@remix-run/router@1.12.0`
628
629## 6.18.0
630
631### Patch Changes
632
633- Fix the `future` prop on `BrowserRouter`, `HashRouter` and `MemoryRouter` so that it accepts a `Partial<FutureConfig>` instead of requiring all flags to be included. ([#10962](https://github.com/remix-run/react-router/pull/10962))
634- Updated dependencies:
635 - `@remix-run/router@1.11.0`
636
637## 6.17.0
638
639### Patch Changes
640
641- Fix `RouterProvider` `future` prop type to be a `Partial<FutureConfig>` so that not all flags must be specified ([#10900](https://github.com/remix-run/react-router/pull/10900))
642- Updated dependencies:
643 - `@remix-run/router@1.10.0`
644
645## 6.16.0
646
647### Minor Changes
648
649- In order to move towards stricter TypeScript support in the future, we're aiming to replace current usages of `any` with `unknown` on exposed typings for user-provided data. To do this in Remix v2 without introducing breaking changes in React Router v6, we have added generics to a number of shared types. These continue to default to `any` in React Router and are overridden with `unknown` in Remix. In React Router v7 we plan to move these to `unknown` as a breaking change. ([#10843](https://github.com/remix-run/react-router/pull/10843))
650 - `Location` now accepts a generic for the `location.state` value
651 - `ActionFunctionArgs`/`ActionFunction`/`LoaderFunctionArgs`/`LoaderFunction` now accept a generic for the `context` parameter (only used in SSR usages via `createStaticHandler`)
652 - The return type of `useMatches` (now exported as `UIMatch`) accepts generics for `match.data` and `match.handle` - both of which were already set to `unknown`
653- Move the `@private` class export `ErrorResponse` to an `UNSAFE_ErrorResponseImpl` export since it is an implementation detail and there should be no construction of `ErrorResponse` instances in userland. This frees us up to export a `type ErrorResponse` which correlates to an instance of the class via `InstanceType`. Userland code should only ever be using `ErrorResponse` as a type and should be type-narrowing via `isRouteErrorResponse`. ([#10811](https://github.com/remix-run/react-router/pull/10811))
654- Export `ShouldRevalidateFunctionArgs` interface ([#10797](https://github.com/remix-run/react-router/pull/10797))
655- Removed private/internal APIs only required for the Remix v1 backwards compatibility layer and no longer needed in Remix v2 (`_isFetchActionRedirect`, `_hasFetcherDoneAnything`) ([#10715](https://github.com/remix-run/react-router/pull/10715))
656
657### Patch Changes
658
659- Updated dependencies:
660 - `@remix-run/router@1.9.0`
661
662## 6.15.0
663
664### Minor Changes
665
666- Add's a new `redirectDocument()` function which allows users to specify that a redirect from a `loader`/`action` should trigger a document reload (via `window.location`) instead of attempting to navigate to the redirected location via React Router ([#10705](https://github.com/remix-run/react-router/pull/10705))
667
668### Patch Changes
669
670- Ensure `useRevalidator` is referentially stable across re-renders if revalidations are not actively occurring ([#10707](https://github.com/remix-run/react-router/pull/10707))
671- Updated dependencies:
672 - `@remix-run/router@1.8.0`
673
674## 6.14.2
675
676### Patch Changes
677
678- Updated dependencies:
679 - `@remix-run/router@1.7.2`
680
681## 6.14.1
682
683### Patch Changes
684
685- Fix loop in `unstable_useBlocker` when used with an unstable blocker function ([#10652](https://github.com/remix-run/react-router/pull/10652))
686- Fix issues with reused blockers on subsequent navigations ([#10656](https://github.com/remix-run/react-router/pull/10656))
687- Updated dependencies:
688 - `@remix-run/router@1.7.1`
689
690## 6.14.0
691
692### Patch Changes
693
694- Strip `basename` from locations provided to `unstable_useBlocker` functions to match `useLocation` ([#10573](https://github.com/remix-run/react-router/pull/10573))
695- Fix `generatePath` when passed a numeric `0` value parameter ([#10612](https://github.com/remix-run/react-router/pull/10612))
696- Fix `unstable_useBlocker` key issues in `StrictMode` ([#10573](https://github.com/remix-run/react-router/pull/10573))
697- Fix `tsc --skipLibCheck:false` issues on React 17 ([#10622](https://github.com/remix-run/react-router/pull/10622))
698- Upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
699- Updated dependencies:
700 - `@remix-run/router@1.7.0`
701
702## 6.13.0
703
704### Minor Changes
705
706- Move [`React.startTransition`](https://react.dev/reference/react/startTransition) usage behind a [future flag](https://reactrouter.com/v6/guides/api-development-strategy) to avoid issues with existing incompatible `Suspense` usages. We recommend folks adopting this flag to be better compatible with React concurrent mode, but if you run into issues you can continue without the use of `startTransition` until v7. Issues usually boils down to creating net-new promises during the render cycle, so if you run into issues you should either lift your promise creation out of the render cycle or put it behind a `useMemo`. ([#10596](https://github.com/remix-run/react-router/pull/10596))
707
708 Existing behavior will no longer include `React.startTransition`:
709
710 ```jsx
711 <BrowserRouter>
712 <Routes>{/*...*/}</Routes>
713 </BrowserRouter>
714
715 <RouterProvider router={router} />
716 ```
717
718 If you wish to enable `React.startTransition`, pass the future flag to your component:
719
720 ```jsx
721 <BrowserRouter future={{ v7_startTransition: true }}>
722 <Routes>{/*...*/}</Routes>
723 </BrowserRouter>
724
725 <RouterProvider router={router} future={{ v7_startTransition: true }}/>
726 ```
727
728### Patch Changes
729
730- Work around webpack/terser `React.startTransition` minification bug in production mode ([#10588](https://github.com/remix-run/react-router/pull/10588))
731
732## 6.12.1
733
734> \[!WARNING]
735> Please use version `6.13.0` or later instead of `6.12.1`. This version suffers from a `webpack`/`terser` minification issue resulting in invalid minified code in your resulting production bundles which can cause issues in your application. See [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.
736
737### Patch Changes
738
739- Adjust feature detection of `React.startTransition` to fix webpack + react 17 compilation error ([#10569](https://github.com/remix-run/react-router/pull/10569))
740
741## 6.12.0
742
743### Minor Changes
744
745- Wrap internal router state updates with `React.startTransition` if it exists ([#10438](https://github.com/remix-run/react-router/pull/10438))
746
747### Patch Changes
748
749- Updated dependencies:
750 - `@remix-run/router@1.6.3`
751
752## 6.11.2
753
754### Patch Changes
755
756- Fix `basename` duplication in descendant `<Routes>` inside a `<RouterProvider>` ([#10492](https://github.com/remix-run/react-router/pull/10492))
757- Updated dependencies:
758 - `@remix-run/router@1.6.2`
759
760## 6.11.1
761
762### Patch Changes
763
764- Fix usage of `Component` API within descendant `<Routes>` ([#10434](https://github.com/remix-run/react-router/pull/10434))
765- Fix bug when calling `useNavigate` from `<Routes>` inside a `<RouterProvider>` ([#10432](https://github.com/remix-run/react-router/pull/10432))
766- Fix usage of `<Navigate>` in strict mode when using a data router ([#10435](https://github.com/remix-run/react-router/pull/10435))
767- Updated dependencies:
768 - `@remix-run/router@1.6.1`
769
770## 6.11.0
771
772### Patch Changes
773
774- Log loader/action errors to the console in dev for easier stack trace evaluation ([#10286](https://github.com/remix-run/react-router/pull/10286))
775- Fix bug preventing rendering of descendant `<Routes>` when `RouterProvider` errors existed ([#10374](https://github.com/remix-run/react-router/pull/10374))
776- Fix inadvertent re-renders when using `Component` instead of `element` on a route definition ([#10287](https://github.com/remix-run/react-router/pull/10287))
777- Fix detection of `useNavigate` in the render cycle by setting the `activeRef` in a layout effect, allowing the `navigate` function to be passed to child components and called in a `useEffect` there. ([#10394](https://github.com/remix-run/react-router/pull/10394))
778- Switched from `useSyncExternalStore` to `useState` for internal `@remix-run/router` router state syncing in `<RouterProvider>`. We found some [subtle bugs](https://codesandbox.io/s/use-sync-external-store-loop-9g7b81) where router state updates got propagated _before_ other normal `useState` updates, which could lead to footguns in `useEffect` calls. ([#10377](https://github.com/remix-run/react-router/pull/10377), [#10409](https://github.com/remix-run/react-router/pull/10409))
779- Allow `useRevalidator()` to resolve a loader-driven error boundary scenario ([#10369](https://github.com/remix-run/react-router/pull/10369))
780- Avoid unnecessary unsubscribe/resubscribes on router state changes ([#10409](https://github.com/remix-run/react-router/pull/10409))
781- When using a `RouterProvider`, `useNavigate`/`useSubmit`/`fetcher.submit` are now stable across location changes, since we can handle relative routing via the `@remix-run/router` instance and get rid of our dependence on `useLocation()`. When using `BrowserRouter`, these hooks remain unstable across location changes because they still rely on `useLocation()`. ([#10336](https://github.com/remix-run/react-router/pull/10336))
782- Updated dependencies:
783 - `@remix-run/router@1.6.0`
784
785## 6.10.0
786
787### Minor Changes
788
789- Added support for [**Future Flags**](https://reactrouter.com/v6/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
790
791 - When `future.v7_normalizeFormMethod === false` (default v6 behavior),
792 - `useNavigation().formMethod` is lowercase
793 - `useFetcher().formMethod` is lowercase
794 - When `future.v7_normalizeFormMethod === true`:
795 - `useNavigation().formMethod` is uppercase
796 - `useFetcher().formMethod` is uppercase
797
798### Patch Changes
799
800- Fix route ID generation when using Fragments in `createRoutesFromElements` ([#10193](https://github.com/remix-run/react-router/pull/10193))
801- Updated dependencies:
802 - `@remix-run/router@1.5.0`
803
804## 6.9.0
805
806### Minor Changes
807
808- React Router now supports an alternative way to define your route `element` and `errorElement` fields as React Components instead of React Elements. You can instead pass a React Component to the new `Component` and `ErrorBoundary` fields if you choose. There is no functional difference between the two, so use whichever approach you prefer 😀. You shouldn't be defining both, but if you do `Component`/`ErrorBoundary` will "win". ([#10045](https://github.com/remix-run/react-router/pull/10045))
809
810 **Example JSON Syntax**
811
812 ```jsx
813 // Both of these work the same:
814 const elementRoutes = [{
815 path: '/',
816 element: <Home />,
817 errorElement: <HomeError />,
818 }]
819
820 const componentRoutes = [{
821 path: '/',
822 Component: Home,
823 ErrorBoundary: HomeError,
824 }]
825
826 function Home() { ... }
827 function HomeError() { ... }
828 ```
829
830 **Example JSX Syntax**
831
832 ```jsx
833 // Both of these work the same:
834 const elementRoutes = createRoutesFromElements(
835 <Route path='/' element={<Home />} errorElement={<HomeError /> } />
836 );
837
838 const componentRoutes = createRoutesFromElements(
839 <Route path='/' Component={Home} ErrorBoundary={HomeError} />
840 );
841
842 function Home() { ... }
843 function HomeError() { ... }
844 ```
845
846- **Introducing Lazy Route Modules!** ([#10045](https://github.com/remix-run/react-router/pull/10045))
847
848 In order to keep your application bundles small and support code-splitting of your routes, we've introduced a new `lazy()` route property. This is an async function that resolves the non-route-matching portions of your route definition (`loader`, `action`, `element`/`Component`, `errorElement`/`ErrorBoundary`, `shouldRevalidate`, `handle`).
849
850 Lazy routes are resolved on initial load and during the `loading` or `submitting` phase of a navigation or fetcher call. You cannot lazily define route-matching properties (`path`, `index`, `children`) since we only execute your lazy route functions after we've matched known routes.
851
852 Your `lazy` functions will typically return the result of a dynamic import.
853
854 ```jsx
855 // In this example, we assume most folks land on the homepage so we include that
856 // in our critical-path bundle, but then we lazily load modules for /a and /b so
857 // they don't load until the user navigates to those routes
858 let routes = createRoutesFromElements(
859 <Route path="/" element={<Layout />}>
860 <Route index element={<Home />} />
861 <Route path="a" lazy={() => import("./a")} />
862 <Route path="b" lazy={() => import("./b")} />
863 </Route>
864 );
865 ```
866
867 Then in your lazy route modules, export the properties you want defined for the route:
868
869 ```jsx
870 export async function loader({ request }) {
871 let data = await fetchData(request);
872 return json(data);
873 }
874
875 // Export a `Component` directly instead of needing to create a React Element from it
876 export function Component() {
877 let data = useLoaderData();
878
879 return (
880 <>
881 <h1>You made it!</h1>
882 <p>{data}</p>
883 </>
884 );
885 }
886
887 // Export an `ErrorBoundary` directly instead of needing to create a React Element from it
888 export function ErrorBoundary() {
889 let error = useRouteError();
890 return isRouteErrorResponse(error) ? (
891 <h1>
892 {error.status} {error.statusText}
893 </h1>
894 ) : (
895 <h1>{error.message || error}</h1>
896 );
897 }
898 ```
899
900 An example of this in action can be found in the [`examples/lazy-loading-router-provider`](https://github.com/remix-run/react-router/tree/main/examples/lazy-loading-router-provider) directory of the repository.
901
902 🙌 Huge thanks to @rossipedia for the [Initial Proposal](https://github.com/remix-run/react-router/discussions/9826) and [POC Implementation](https://github.com/remix-run/react-router/pull/9830).
903
904- Updated dependencies:
905 - `@remix-run/router@1.4.0`
906
907### Patch Changes
908
909- Fix `generatePath` incorrectly applying parameters in some cases ([#10078](https://github.com/remix-run/react-router/pull/10078))
910- Improve memoization for context providers to avoid unnecessary re-renders ([#9983](https://github.com/remix-run/react-router/pull/9983))
911
912## 6.8.2
913
914### Patch Changes
915
916- Updated dependencies:
917 - `@remix-run/router@1.3.3`
918
919## 6.8.1
920
921### Patch Changes
922
923- Remove inaccurate console warning for POP navigations and update active blocker logic ([#10030](https://github.com/remix-run/react-router/pull/10030))
924- Updated dependencies:
925 - `@remix-run/router@1.3.2`
926
927## 6.8.0
928
929### Patch Changes
930
931- Updated dependencies:
932 - `@remix-run/router@1.3.1`
933
934## 6.7.0
935
936### Minor Changes
937
938- Add `unstable_useBlocker` hook for blocking navigations within the app's location origin ([#9709](https://github.com/remix-run/react-router/pull/9709))
939
940### Patch Changes
941
942- Fix `generatePath` when optional params are present ([#9764](https://github.com/remix-run/react-router/pull/9764))
943- Update `<Await>` to accept `ReactNode` as children function return result ([#9896](https://github.com/remix-run/react-router/pull/9896))
944- Updated dependencies:
945 - `@remix-run/router@1.3.0`
946
947## 6.6.2
948
949### Patch Changes
950
951- Ensure `useId` consistency during SSR ([#9805](https://github.com/remix-run/react-router/pull/9805))
952
953## 6.6.1
954
955### Patch Changes
956
957- Updated dependencies:
958 - `@remix-run/router@1.2.1`
959
960## 6.6.0
961
962### Patch Changes
963
964- Prevent `useLoaderData` usage in `errorElement` ([#9735](https://github.com/remix-run/react-router/pull/9735))
965- Updated dependencies:
966 - `@remix-run/router@1.2.0`
967
968## 6.5.0
969
970This release introduces support for [Optional Route Segments](https://github.com/remix-run/react-router/issues/9546). Now, adding a `?` to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters.
971
972**Optional Params Examples**
973
974- `<Route path=":lang?/about>` will match:
975 - `/:lang/about`
976 - `/about`
977- `<Route path="/multistep/:widget1?/widget2?/widget3?">` will match:
978 - `/multistep`
979 - `/multistep/:widget1`
980 - `/multistep/:widget1/:widget2`
981 - `/multistep/:widget1/:widget2/:widget3`
982
983**Optional Static Segment Example**
984
985- `<Route path="/home?">` will match:
986 - `/`
987 - `/home`
988- `<Route path="/fr?/about">` will match:
989 - `/about`
990 - `/fr/about`
991
992### Minor Changes
993
994- Allows optional routes and optional static segments ([#9650](https://github.com/remix-run/react-router/pull/9650))
995
996### Patch Changes
997
998- Stop incorrectly matching on partial named parameters, i.e. `<Route path="prefix-:param">`, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the `useParams` call site: ([#9506](https://github.com/remix-run/react-router/pull/9506))
999
1000```jsx
1001// Old behavior at URL /prefix-123
1002<Route path="prefix-:id" element={<Comp /> }>
1003
1004function Comp() {
1005 let params = useParams(); // { id: '123' }
1006 let id = params.id; // "123"
1007 ...
1008}
1009
1010// New behavior at URL /prefix-123
1011<Route path=":id" element={<Comp /> }>
1012
1013function Comp() {
1014 let params = useParams(); // { id: 'prefix-123' }
1015 let id = params.id.replace(/^prefix-/, ''); // "123"
1016 ...
1017}
1018```
1019
1020- Updated dependencies:
1021 - `@remix-run/router@1.1.0`
1022
1023## 6.4.5
1024
1025### Patch Changes
1026
1027- Updated dependencies:
1028 - `@remix-run/router@1.0.5`
1029
1030## 6.4.4
1031
1032### Patch Changes
1033
1034- Updated dependencies:
1035 - `@remix-run/router@1.0.4`
1036
1037## 6.4.3
1038
1039### Patch Changes
1040
1041- `useRoutes` should be able to return `null` when passing `locationArg` ([#9485](https://github.com/remix-run/react-router/pull/9485))
1042- fix `initialEntries` type in `createMemoryRouter` ([#9498](https://github.com/remix-run/react-router/pull/9498))
1043- Updated dependencies:
1044 - `@remix-run/router@1.0.3`
1045
1046## 6.4.2
1047
1048### Patch Changes
1049
1050- Fix `IndexRouteObject` and `NonIndexRouteObject` types to make `hasErrorElement` optional ([#9394](https://github.com/remix-run/react-router/pull/9394))
1051- Enhance console error messages for invalid usage of data router hooks ([#9311](https://github.com/remix-run/react-router/pull/9311))
1052- If an index route has children, it will result in a runtime error. We have strengthened our `RouteObject`/`RouteProps` types to surface the error in TypeScript. ([#9366](https://github.com/remix-run/react-router/pull/9366))
1053- Updated dependencies:
1054 - `@remix-run/router@1.0.2`
1055
1056## 6.4.1
1057
1058### Patch Changes
1059
1060- Preserve state from `initialEntries` ([#9288](https://github.com/remix-run/react-router/pull/9288))
1061- Updated dependencies:
1062 - `@remix-run/router@1.0.1`
1063
1064## 6.4.0
1065
1066Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/en/6.4.0/start/overview) and the [tutorial](https://reactrouter.com/en/6.4.0/start/tutorial).
1067
1068**New APIs**
1069
1070- Create your router with `createMemoryRouter`
1071- Render your router with `<RouterProvider>`
1072- Load data with a Route `loader` and mutate with a Route `action`
1073- Handle errors with Route `errorElement`
1074- Defer non-critical data with `defer` and `Await`
1075
1076**Bug Fixes**
1077
1078- Path resolution is now trailing slash agnostic (#8861)
1079- `useLocation` returns the scoped location inside a `<Routes location>` component (#9094)
1080
1081**Updated Dependencies**
1082
1083- `@remix-run/router@1.0.0`