with-async-component
v0.0.8
Published
No-frills HOC to asynchronously load React components for code-splitting purposes.
Downloads
18
Readme
withAsync
No-frills HOC to asynchronously load React components for code-splitting purposes.
import { withAsync } from 'with-async-component'
const getComponent = () => import('./App')
const LoadingOverlay = props => props.loading ? <div>Loading...</div> : props.children
const App = withAsync(LoadingOverlay)(getComponent)