Implement history
This commit is contained in:
parent
51f0dbce32
commit
56aeb285c0
1 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Switch, Route } from 'react-router-dom'
|
import { Router, Route } from 'react-router-dom'
|
||||||
|
|
||||||
|
import history from '~utils/history'
|
||||||
|
|
||||||
import New from '~routes/New/New'
|
import New from '~routes/New/New'
|
||||||
import Party from '~routes/Party/Party'
|
import Party from '~routes/Party/Party'
|
||||||
|
|
@ -12,11 +14,11 @@ import Parties from '~routes/Parties/Parties'
|
||||||
// when the pathname is exactly the string "/"
|
// when the pathname is exactly the string "/"
|
||||||
const Main = () => (
|
const Main = () => (
|
||||||
<main>
|
<main>
|
||||||
<Switch>
|
<Router history={history}>
|
||||||
<Route exact path='/' component={New} />
|
<Route exact path='/' component={New} />
|
||||||
<Route exact path='/parties/' component={Parties} />
|
<Route exact path='/parties/' component={Parties} />
|
||||||
<Route path='/p/:hash' component={Party} />
|
<Route path='/p/:hash' component={Party} />
|
||||||
</Switch>
|
</Router>
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue