Answer the question
In order to leave comments, you need to log in
How to pass multiple actions to matchDispatchToProps? And in mapStateToprops there are several states (for each reducer)?
function mapStateToProps(state){
return {
cars: state.cars
};
}
function matchDispatchToProps(dispatch){
return bindActionCreators({select: select}, dispatch)
}
Answer the question
In order to leave comments, you need to log in
const mapStateToProps = ({ cars, motocycle }) => ({ cars, motocycle })
const matchDispatchToProps = dispatch => ({
select: () => dispatch(select),
delete: () => dispatch(delete)
})
delete: (id) => dispatch(delete(id))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question