36 lines
826 B
TypeScript
36 lines
826 B
TypeScript
|
|
import React from 'react';
|
|
import { BrowserRouter, Route, Switch, HashRouter, Redirect, Link } from 'react-router-dom';
|
|
|
|
|
|
import Home from '../pages/home';
|
|
|
|
class HomeRouter extends React.Component {
|
|
|
|
render() {
|
|
return (
|
|
<BrowserRouter>
|
|
<Switch>
|
|
<Route exact path="/" >
|
|
|
|
<Redirect to={{pathname: "/content"}} >
|
|
...{console.log("redirect")}
|
|
</Redirect>
|
|
|
|
</Route>
|
|
<Route path="/content" component={Home}>
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
{/* <Route exact path="/home" component={Home} ></Route> */}
|
|
</Switch>
|
|
</BrowserRouter>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default HomeRouter;
|
|
|