Last active
April 28, 2019 04:49
-
-
Save AnkurVyas-BTC/d54df032cec734409dfa6c0c901846f9 to your computer and use it in GitHub Desktop.
React Loadble big component!
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'; | |
function Loading() { | |
return <div>Loading...</div>; | |
} | |
const LoadableBigComponent = Loadable({ | |
loader: () => import('../components/BigComponent'), | |
loading: Loading | |
}); | |
class MainComponent extends React.Component { | |
render() { | |
return <LoadableBigComponent/>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment