Created
July 6, 2018 08:27
-
-
Save MicroBenz/78ba993985c28be769a22606cfd6209d to your computer and use it in GitHub Desktop.
React Code Splitting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Loadable from 'react-loadable'; | |
const Bar = Loadable({ | |
loader: () => import('./components/Bar'), | |
loading: () => <div>Loading...</div> | |
}); | |
class MyComponent extends React.Component { | |
render() { | |
return <Bar />; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment