I am currently facing a strange problem where the HOC withRouterprovided react-routerdoes not pass the details to the mapStateToProps function. Am I doing it wrong here?
import React, { Component } from 'react';
import { Link, withRouter } from 'react-router';
import { connect } from 'react-redux';
class ThisClass extends Component {
render() {
console.log(this.props.router);
}
}
const mapStateToProps = (state, props) => {
console.log(state);
console.log(props);
return {
consultations: patientThisClassSelector(state, props)
};
}
export default connect(mapStateToProps)(withRouter(ThisClass));
source
share