2021-06-12 17:07:54 +07:00
|
|
|
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
|
|
|
|
import { routes } from './routes'
|
2021-06-12 14:51:22 +07:00
|
|
|
|
|
|
|
const RouterView = () => {
|
2021-06-12 17:07:54 +07:00
|
|
|
return (
|
|
|
|
<Router>
|
|
|
|
<Switch>
|
|
|
|
{routes.map((route) => {
|
|
|
|
return (
|
|
|
|
<Route
|
|
|
|
key={route.key}
|
|
|
|
exact={route.exact}
|
|
|
|
component={route.component}
|
|
|
|
children={route.children}
|
|
|
|
location={route.location}
|
|
|
|
path={route.path}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
</Switch>
|
|
|
|
</Router>
|
|
|
|
)
|
2021-06-12 14:51:22 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default RouterView
|