Skip to content

Commit 34d66a6

Browse files
author
hafidz
committed
updates routes
1 parent 2f519a0 commit 34d66a6

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

client/src/components/App.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
import React from 'react'
2+
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
23

34
import Popular from './Popular.js'
5+
import Battle from './Battle.js'
6+
import Home from './Home.js'
7+
import Nav from './Nav.js'
8+
9+
const App = props =>
10+
(
11+
<Router>
12+
<div className='app'>
13+
<Nav />
14+
15+
<Switch>
16+
<Route exact path='/' component={Home}/>
17+
<Route path ='/battle' component={Battle} />
18+
<Route path ='/popular' component={Popular} />
19+
<Route render={() => <p>NOT FOUND</p>} />
20+
</Switch>
21+
</div>
22+
</Router>
23+
)
424

5-
class App extends React.Component {
6-
render() {
7-
return (
8-
<div className="popular">
9-
<Popular />
10-
</div>
11-
)
12-
}
13-
}
1425

1526
export default App

0 commit comments

Comments
 (0)