File tree 5 files changed +119
-141
lines changed
5 files changed +119
-141
lines changed Original file line number Diff line number Diff line change 6
6
"react-scripts" : " 1.0.0"
7
7
},
8
8
"dependencies" : {
9
- "react" : " ^15.4.2 " ,
10
- "react-dom" : " ^15.4.2 " ,
11
- "react-redux" : " ^5.0.3 " ,
12
- "react-router" : " ^4.0.0 " ,
13
- "react-router-dom" : " ^4.0.0 " ,
9
+ "react" : " ^15.5.4 " ,
10
+ "react-dom" : " ^15.5.4 " ,
11
+ "react-redux" : " ^5.0.5 " ,
12
+ "react-router" : " ^4.1.1 " ,
13
+ "react-router-dom" : " ^4.1.1 " ,
14
14
"react-router-redux" : " next" ,
15
15
"redux" : " ^3.6.0" ,
16
16
"redux-thunk" : " ^2.2.0" ,
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import { Link } from 'react-router-dom'
2
+ import { Route , Link } from 'react-router-dom'
3
+ import Home from '../home'
4
+ import About from '../about'
3
5
4
6
const App = ( { children } ) => (
5
7
< div >
@@ -9,7 +11,8 @@ const App = ({ children }) => (
9
11
</ header >
10
12
11
13
< main >
12
- { children }
14
+ < Route exact path = "/" component = { Home } />
15
+ < Route exact path = "/about-us" component = { About } />
13
16
</ main >
14
17
</ div >
15
18
)
Original file line number Diff line number Diff line change @@ -39,9 +39,7 @@ const mapDispatchToProps = dispatch => bindActionCreators({
39
39
incrementAsync,
40
40
decrement,
41
41
decrementAsync,
42
- changePage : ( ) => {
43
- dispatch ( push ( '/about-us' ) )
44
- }
42
+ changePage : ( ) => push ( '/about-us' )
45
43
} , dispatch )
46
44
47
45
export default connect (
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import { render } from 'react-dom'
3
3
import { Provider } from 'react-redux'
4
- import { Route } from 'react-router'
5
4
import { ConnectedRouter } from 'react-router-redux'
6
5
import store , { history } from './store'
7
6
import App from './containers/app'
8
- import Home from './containers/home'
9
- import About from './containers/about'
10
7
11
8
import 'sanitize.css/sanitize.css'
12
9
import './index.css'
@@ -16,10 +13,9 @@ const target = document.querySelector('#root')
16
13
render (
17
14
< Provider store = { store } >
18
15
< ConnectedRouter history = { history } >
19
- < App >
20
- < Route exact path = "/" component = { Home } />
21
- < Route exact path = "/about-us" component = { About } />
22
- </ App >
16
+ < div >
17
+ < App />
18
+ </ div >
23
19
</ ConnectedRouter >
24
20
</ Provider > ,
25
21
target
You can’t perform that action at this time.
0 commit comments