refactor: remove basename

This commit is contained in:
Tristan 2019-09-24 22:05:16 +08:00
parent 4147cc0f24
commit 7091b59fb3

View File

@ -3,13 +3,12 @@ import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Home from './pages/index';
import SharePage from './pages/share';
const basePath = process.env.NODE_ENV === 'production' ? '/chinese-colors' : '';
const App = () => {
return (
<Router basename={basePath}>
<Router>
<Switch>
<Route path={`${basePath}/`} exact component={Home} />
<Route path={`${basePath}/share/:id`} component={SharePage} />
<Route path={`/`} exact component={Home} />
<Route path={`/share/:id`} component={SharePage} />
</Switch>
</Router>
);