Skip to content

Commit d25e4ff

Browse files
fixing routing bug
1 parent 3ecb484 commit d25e4ff

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/App.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ class App extends Component {
3636
render() {
3737
return(
3838
<div className="app">
39-
{/* <HomePage allNotes={this.state.allNotes}></HomePage> */}
4039
<Router>
41-
<Route exact path='/'>
42-
<HomePage allNotes={this.state.allNotes}></HomePage>
43-
</Route>
44-
<Route path='/:id' component={NoteDetail} />
45-
<Route path='/add_note' component={AddNote} />
40+
<Switch>
41+
<Route exact path='/add_note' component={AddNote} />
42+
<Route exact path='/:id' component={NoteDetail} />
43+
<Route exact path='/'>
44+
<HomePage allNotes={this.state.allNotes}></HomePage>
45+
</Route>
46+
</Switch>
4647
</Router>
48+
49+
4750
</div>
4851
)
4952
};

0 commit comments

Comments
 (0)