Skip to content

Instantly share code, notes, and snippets.

@AnkurVyas-BTC
Last active April 28, 2019 04:49
Show Gist options
  • Save AnkurVyas-BTC/d54df032cec734409dfa6c0c901846f9 to your computer and use it in GitHub Desktop.
Save AnkurVyas-BTC/d54df032cec734409dfa6c0c901846f9 to your computer and use it in GitHub Desktop.
React Loadble big component!
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