Add note about Promise polyfill for React.lazy (#1556)

* Add note about Promise polyfill for React.lazy

Fixes #1552

* Backticks
This commit is contained in:
Alex Krolick
2019-01-15 10:11:28 -08:00
committed by GitHub
parent 60dd46d64b
commit 165ae047b4

View File

@@ -310,6 +310,10 @@ const SomeComponent = React.lazy(() => import('./SomeComponent'));
Note that rendering `lazy` components requires that there's a `<React.Suspense>` component higher in the rendering tree. This is how you specify a loading indicator.
> **Note**
>
> Using `React.lazy`with dynamic import requires Promises to be available in the JS environment. This requires a polyfill on IE11 and below.
### `React.Suspense`
`React.Suspense` let you specify the loading indicator in case some components in the tree below it are not yet ready to render. Today, lazy loading components is the **only** use case supported by `<React.Suspense>`: