react-route-async
v1.0.2
Published
Build asynchronous routes in a very easy way with react-router-async
Downloads
1
Readme
React route asynchronous
Build asynchronous routes in a very easy way with react-router-async
npm install react-route-async --save
import React, { Component } from 'react';
import { Route, Switch } from 'react-router-dom';
import asyncComponent from './hoc/AsyncComponent/AsyncComponent';
const asyncLogout = asyncComponent(() => {
return import('./containers/Logout/Logout');
});
class App extends Component {
render() {
<Switch>
<Route path="/logout" component={asyncLogout} />
// ...
</Switch>
}
}
export default App;