0.0.8 • Published 6 years ago
with-async-component v0.0.8
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)