Skip to content

Commit 4366a72

Browse files
committed
Update changeset
1 parent 04287d2 commit 4366a72

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.changeset/silent-apples-return.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
11
---
2-
"react-router": patch
2+
"react-router": minor
33
---
44

5-
Add support for `route.unstable_lazyMiddleware` function to allow lazy loading of middleware logic.
5+
Add granular object-based API for `route.lazy` to support lazy loading of individual route properties, for example:
6+
7+
```ts
8+
createBrowserRouter([
9+
{
10+
path: "/show/:showId",
11+
lazy: {
12+
loader: async () => (await import("./show.loader.js")).loader,
13+
action: async () => (await import("./show.action.js")).action,
14+
Component: async () => (await import("./show.component.js")).Component,
15+
},
16+
},
17+
]);
18+
```
619

720
**Breaking change for `unstable_middleware` consumers**
821

9-
The `route.unstable_middleware` property is no longer supported in the return value from `route.lazy`. If you want to lazily load middleware, you must use `route.unstable_lazyMiddleware`.
22+
The `route.unstable_middleware` property is no longer supported in the return value from `route.lazy`. If you want to lazily load middleware, you must use the new object-based `route.lazy` API with `route.lazy.unstable_middleware`, for example:
23+
24+
```ts
25+
createBrowserRouter([
26+
{
27+
path: "/show/:showId",
28+
lazy: {
29+
unstable_middleware: async () =>
30+
(await import("./show.middleware.js")).middleware,
31+
// etc.
32+
},
33+
},
34+
]);
35+
```

0 commit comments

Comments
 (0)