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