Skip to content

Instantly share code, notes, and snippets.

@eugeniosegala
Last active October 6, 2018 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugeniosegala/fce4f5ad476d096085a289fc99347ac1 to your computer and use it in GitHub Desktop.
Save eugeniosegala/fce4f5ad476d096085a289fc99347ac1 to your computer and use it in GitHub Desktop.
const MyAwesomeComponent = asyncComponent(() => import('./components/MyAwesomeComponent'));
// some code
render() {
const { ConditionalRender } = this.state;
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
{ConditionalRender &&
<MyAwesomeComponent />
}
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment