react-router-lazy
v1.2.0
Published
react-router 懒加载
Downloads
4
Readme
react-router-lazy
react-router 懒加载
Usage
v3
lazy
import lazy from 'react-router-lazy';
import {Route} from 'react-router; // v3
<Route path="/about" getComponent={lazy(() => import('./modules/ModuleA'))}/>
v4
Route
import {Route} from 'react-router-lazy';
<Route path="/about" getComponent={() => import('./modules/ModuleA')}/>
BundleLoader
import {BundleLoader} from 'react-router-lazy';
<BundleLoader getComponent={import('./module/ModuleA')} {...propsOfModuleA}/>