Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify and fix typo
  • Loading branch information
gaearon authored Oct 19, 2018
commit bb5574633bd3ad412d1c76ec08691553d55bb203
6 changes: 5 additions & 1 deletion text/0000-lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Start Date: 2018-10-19

`React.lazy` adds first-class support for code splitting components to React. It takes a module object and returns a special component type.

>Note
>
>This RFC is intentionally scoped to supporting default imports. We may in the future submit another RFC concerning named imports. In the meantime you can also implement support for named imports in userland with a lower-level Suspense API (to be discussed in another RFC).

# Basic example

```js
Expand Down Expand Up @@ -68,7 +72,7 @@ The second part of the question is why don't we still _allow_ passing something
const Button = lazy(async () => {
const Components = await import('./components');
// Resolve to named export:
return components.Button;
return Components.Button;
});
```

Expand Down