index.js
871 Bytes
import React from 'react';
import { Route, Switch } from 'react-router';
import { ConnectedRouter } from 'connected-react-router';
import LayoutRoute from './layout/LayoutRoute';
import LoginRoute from "./layout/LoginRoute";
class AppRoutes extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() { }
componentWillUnmount() { }
render() {
const { history } = this.props;
if (!history)
return null;
return (
<ConnectedRouter history={history}>
<Switch>
<Route path="/main" component={LayoutRoute} />
<Route path="/login" component={LoginRoute} />
<Route render={() => (<div>Miss</div>)} />
</Switch>
</ConnectedRouter >
);
}
}
export default AppRoutes;