/react-bundle

Lazy load dependencies (using bundle-loader or import())

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

react-bundle

License: BSD-3-Clause npm standard-readme compliant

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