mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
This issue fixes #59 It is possible to create a configuration which will result into a wrong state but it should not happen in 99.99% cases.
24 lines
443 B
JavaScript
24 lines
443 B
JavaScript
import React from 'react'
|
|
import loadable from 'loadable-components'
|
|
import { hot } from 'react-hot-loader'
|
|
import A from './A'
|
|
import B from './B'
|
|
|
|
const AsyncWhat = loadable(() =>
|
|
import(/* webpackChunkName: "What" */ './What.js'),
|
|
)
|
|
|
|
const AsyncBig = loadable(() =>
|
|
import(/* webpackChunkName: "Big" */ './Big.js'),
|
|
)
|
|
|
|
const App = () => (
|
|
<div>
|
|
<A />
|
|
<B />
|
|
Hello <AsyncWhat />!
|
|
</div>
|
|
)
|
|
|
|
export default hot(module)(App)
|