correcting the little routing problem

This commit is contained in:
Nikola Bjelo committed 2018-10-18 16:53:10 +02:00
1 parent dd339f6899
commit f0741afd21
1 file changed
+3 -4
+3 -4
View File
@@ -3,22 +3,21 @@ import { Route, BrowserRouter, Switch } from 'react-router-dom'
const Base = () => (
<p>
base website
Base component
</p>
)
const Added = () => (
<p>
added website
Added component
</p>
)
class App extends Component {
render () {
return (
<BrowserRouter basename={window.location.pathname}>
<BrowserRouter basename={this.props.match.path}>
<Switch>
<p>{window.location.pathname}</p>
<Route exact path='/' component={Base} />
<Route path='/added' component={Added} />
</Switch>