@tfboys/loadable

0.0.3 • Public • Published

react-loadable

naive react loadable

Install

yarn add @tfboys/loadable

Example

import Loadable from '@tfboys/loadable';

const LazyLoading = loadable({
    loader: () => {
        return new Promise((resolve, reject) => {
            // wait 2 seconds
            setTimeout(() => {
                resolve(import('./route/lazy-loading'))
            }, 2000);
        })
    },
    loading: () => { return 'loading' },
})

export default class App extends React.Component {
  render() {
    return <LazyLoading/>;
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @tfboys/loadable

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

113 kB

Total Files

6

Last publish

Collaborators

  • lakerswgq