Skip to content

Commit 23da742

Browse files
committed
re-write router code to fit react router v4
1 parent e632690 commit 23da742

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/containers/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import React from 'react';
22
// import package
3-
import { Router, Route, hashHistory } from 'react-router';
3+
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
44
// import relative path
55
import Home from './Home';
66
import NotFound from './NotFound';
77

8-
// add router key to fix this issue
9-
// https://github.com/reactjs/react-router-redux/issues/179#issuecomment-275576250
108
const Main = () => (
11-
<Router key={Math.random()} history={hashHistory}>
12-
<Route path="/" component={Home} />
13-
<Route path="*" component={NotFound} />
9+
<Router>
10+
<Switch>
11+
<Route exact path="/" component={Home} />
12+
<Route component={NotFound} />
13+
</Switch>
1414
</Router>
1515
);
1616

0 commit comments

Comments
 (0)