I m currently using react-router-redux on a project and everything is working fine except for the fact that i can't figure out how to access the react-router router.
@connect((state, props) => {
return {
notification:state.getIn(['_display', 'notification']),
loadingScreen:state.getIn(['_display', 'loadingScreen']),
route:props.location.pathname
};
})
export default class Consultation extends React.Component {
constructor(props,context) {
super(props, context);
console.log(context.router);
}
componentDidMount(){
const { router } = this.context;
.....
}
render(){
....
}
}
Consultation.contextTypes = {
router: React.PropTypes.object.isRequired,
store:React.PropTypes.object
};
this.context.router is always undefined and i ve tried a lot of things unsuccessfully
i m using react 0.14.6, redux 3.0.2, react-router 2.0.0, react-router-redux 4.0.0