I have the following URL: http://localhost:4400/skills/3
In my react component I then have:
constructor(props) {
super(props);
this.state = { skill_id: props.match.params.skill_id };
}
....
const mapStateToProps = (state, ownProps) => {
return {
skill_id: state.skill_id,
ratingsBySkillId: state.rating.by_skill_id.find(el => el.skill_id === skill_id)
};
};
The problem is state.skill_id
is not available in mapStateToProps? Why? How can I use params in mapStateToProps?