August 2017
Beginner
374 pages
10h 41m
English
We still need to connect the Router component to Redux, in order to pass the route sub-state as a property to it. To connect the Router component to Redux, perform the following steps:
import { connect } from 'react-redux'import Router from '../components/Router.jsx'
const mapStateToProps = (state, props) => { const { route } = state return { route }}
const ConnectedRouter = connect(mapStateToProps)(Router)export default ConnectedRouter
Read now
Unlock full access