Answer the question
In order to leave comments, you need to log in
How to send multiple parameters to action?
Let's say the button in the component takes two parameters
function Component(props) {
return (
<div>
<button onClick={() => props.click_item('par_1', 'par_2')>-</button>
</div>
)
}
function mapDispatchToProps(dispatch) {
return {
click_item: (par_1, par_2) => dispatch(click_item(par_1, par_2))
}
}
Answer the question
In order to leave comments, you need to log in
Try just doing:
const mapDispatchToProps = {
click_item,
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question