react-bundle
v1.1.0
Published
Lazy load dependencies (bundle-loader or import())
Downloads
20
Maintainers
Readme
react-bundle
Lazy load dependencies (using bundle-loader or import()
)
Taken from react-router
Table of Contents
Install
yarn add react-bundle
Usage
Using bundle-loader:
import loadSomething from 'bundle-loader?lazy!./Something'
<Bundle load={loadSomething}>
{(Something) => (
// do something w/ the module
)}
</Bundle>
Using import()
:
<Bundle load={() => import('./Something')}>
{(Something) => (
// do something w/ the module
)}
</Bundle>
License
BSD-3-Clause