Skip to content

lucaslim/react-component-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published