Skip to content

Commit 4b494b9

Browse files
committedAug 18, 2023
Update route.lazy docs
1 parent 496b1fe commit 4b494b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎docs/route/lazy.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let routes = createRoutesFromElements(
2222
);
2323
```
2424

25-
Then in your lazy route modules, export the properties you want defined for the route:
25+
Then in your lazy route modules, export the properties you want defined for the route (`loader`, `Component`, `ErrorBoundary`):
2626

2727
```jsx
2828
export async function loader({ request }) {
@@ -59,6 +59,10 @@ export function ErrorBoundary() {
5959
ErrorBoundary.displayName = "SampleErrorBoundary";
6060
```
6161

62+
<docs-info>
63+
Note that there's no `default` export in this lazy-loaded file. That's because `default` is not a valid key on a route object. These files generally should only export keys you would define on a route object, such as `loader`, `action`, `Component`, `ErrorBoundary`, etc. All exports will be spread directly on the route object unless you manually return an object from `lazy`.
64+
</docs-info>
65+
6266
## Statically Defined Properties
6367

6468
Any properties defined statically on the route cannot be overwritten by the `lazy` function, and you'll receive a console warning if you attempt to overwrite them.

0 commit comments

Comments
 (0)
Please sign in to comment.