Let's say I have this action from the redux store:
const mapDispatchToProps = dispatch => {
return {
someaction: bindActionCreators(someaction, dispatch)
};
};
When I need to use it inside my component do I..
1 - Use the action directly as props:
<SomeInnerComponent onClick={this.props.someaction} />
OR:
2 - Create a method in the component which calls the action. Then call that method in my render():
someAction() {
this.props.someaction();
}
render() {
<SomeInnerComponent onClick={this.someAction} />
}
What is the best practice?