A higher order component for loading components with promises.
null until after a
delay (default: 200ms)
delay and before
loader() is successful
Component returned by
loader() on success
- Shows optional
<ErrorComponent/> any time the
loader() fails until it succeeds.
- Avoids flashing states when it doesn't need to.
- Designed around module bundlers like Webpack (async imports work statically)
- Supports server-side rendering via a dynamic
- Eagerly preload components when needed
... read the whole story at github.com.
// @flow import path from 'path'; import React from 'react'; import