forked from Algy/swpp-react-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathApp.js
More file actions
24 lines (22 loc) · 786 Bytes
/
App.js
File metadata and controls
24 lines (22 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import './App.css';
import TodoList from './containers/TodoList/TodoList';
import {BrowserRouter, Route, Redirect, Switch} from 'react-router-dom';
import NewTodo from './containers/TodoList/NewTodo/NewTodo';
import TodoDetail from './components/TodoDetail/TodoDetail';
function App() {
return (
<BrowserRouter>
<div className="App">
<Switch>
<Route path='/todos' exact render={() => <TodoList title="My TODOs!" />} />
<Route path='/todos/:id' exact component={TodoDetail}/>
<Route path='/new-todo' exact component={NewTodo} />
<Redirect exact from='/' to='todos' />
<Route render={()=><h1>Not Found</h1>}/>
</Switch>
</div>
</BrowserRouter>
);
}
export default App;