mirror of
https://github.com/zerosoul/chinese-colors.git
synced 2024-11-27 04:40:12 +08:00
refactor: remove basename
This commit is contained in:
parent
4147cc0f24
commit
7091b59fb3
@ -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>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user