src/components/AsyncComponent/index.js
// Render the component if it has completed loading
Render the component if it has completed loading
Render the component if it has completed loading
render() {
      const C = this.state.component;
      return C ? <C className="async__loaded" {...this.props} /> : null;
    }
render ( ) { const C = this . state . component ; return C ? < C className = "async__loaded" { ... this . props } / > : null ; }
Render the component if it has completed loading
Render the component if it has completed loading
// The loaded component // We can add a spinner here // const Loading = () => ( //   <div style={{ color: '#db7093' }}>Component not loaded yet...</div> // );