1.0.2 • Published 8 years ago

react-component-async v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

React Component Async

Installation

$ yarn add react-component-async

Usage

// using ES6 modules

import AsyncComponent from 'react-component-async';

export const Header = ({ children }) =>
  <header className={'container'}>
    <AsyncComponent getComponent={async () => {
      const component = await import('components/menu');
      const Menu = component.default;

      return <Menu someProps={...} />;
    }} />
  </header>