mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
- Add a new `render` method to use render props pattern - Fix all issues with SSR BREAKING CHANGE: loadable-components/babel is now required if you do server side rendering. BREAKING CHANGE: ErrorComponent now receive `ownProps` instead of `props`.
20 lines
426 B
JavaScript
20 lines
426 B
JavaScript
import React from 'react'
|
|
import loadable from 'loadable-components'
|
|
|
|
const What = loadable(
|
|
async () => {
|
|
const { default: DeepWord } = await import('./DeepWorld')
|
|
const { default: DeepAmazing } = await import('./DeepAmazing')
|
|
return () => (
|
|
<React.Fragment>
|
|
<DeepAmazing /> <DeepWord />
|
|
</React.Fragment>
|
|
)
|
|
},
|
|
{
|
|
LoadingComponent: () => 'Loading...',
|
|
},
|
|
)
|
|
|
|
export default What
|