lazy-route
Version:
Lazy / async route loading for React Router 4
28 lines (18 loc) • 658 B
Markdown
with React Router 4 and Webpack 2 (because of System.import).
Installation:
`npm install lazy-route` or `yarn add lazy-route`
How to use with React Router 4:
```javascript
import {Match} from 'react-router'
import LazyRoute from 'lazy-route'
<Match
pattern="/myroute"
render={(props) => <LazyRoute {...props} component={import('./myComponent')} />}
/>
```
The component works, but I have yet to add tests and some polish to it,
the plan is to add a customizable loader etc.
This component only works