forked from njsh4261/swpp-redux-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathApp.js
More file actions
27 lines (23 loc) · 881 Bytes
/
Copy pathApp.js
File metadata and controls
27 lines (23 loc) · 881 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
26
27
import React from 'react';
import './App.css';
import { ConnectedRouter } from 'connected-react-router';
import TodoList from './containers/TodoList/TodoList';
import RealDetail from './containers/TodoList/RealDetail/RealDetail';
import NewTodo from './containers/TodoList/NewTodo/NewTodo';
import { Route, Redirect, Switch } from 'react-router-dom';
function App(props) {
return (
<ConnectedRouter history={props.history}>
<div className="App" >
<Switch>
<Route path='/todos' exact render={() => <TodoList title="My TODOs!" />} />
<Route path='/todos/:id' exact component={RealDetail} />
<Route path='/new-todo' exact component={NewTodo} />
<Redirect exact from='/' to='todos' />
<Route render={() => <h1>Not Found</h1>} />
</Switch>
</div >
</ConnectedRouter>
);
}
export default App;