Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 2bb4bc7

Browse files
authored
docs: 📚️added missing selector function in async components (#133)
1 parent e7794c8 commit 2bb4bc7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/building-blocks/async-components.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ export const HomePage = lazyLoad(
1818
In this case, the app won't show anything while loading your component. You can, however, make it display a custom loader with:
1919

2020
```ts
21-
import * as React from 'react';
21+
import React from 'react';
2222
import { lazyLoad } from 'utils/loadable';
2323

24-
export const HomePage = lazyLoad(() => import('./index'), {
25-
fallback: <div>Loading...</div>,
26-
});
24+
export const HomePage = lazyLoad(
25+
() => import('./index'),
26+
module => module.HomePage,
27+
{
28+
fallback: <div>Loading...</div>,
29+
}
30+
);
2731
```
2832

33+
Make sure to rename your `Loadable.ts` file to `Loadable.tsx`.
2934
This feature is built into the boilerplate using React's `lazy` and `Suspense` features.

0 commit comments

Comments
 (0)