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
25 lines (23 loc) · 764 Bytes
/
Copy pathApp.js
File metadata and controls
25 lines (23 loc) · 764 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
25
import React from 'react';
import logo from './logo.svg';
import './App.css';
import TodoDetail from './components/TodoDetail/TodoDetail';
import TodoList from './containers/TodoList/TodoList';
import { BrowserRouter, Route, Redirect, Switch } from 'react-router-dom';
import NewTodo from './containers/NewTodo/NewTodo';
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;