how to pass value with bindActionCreators?
Instead of passing the event args, pass in e.target.value. That value will be the first argument in the action creator. Component code should be:
handleSubmit(e) {
this.props.onTimeChange(e.target.value);
}
You can try the following:
function mapDispatchToProps(dispatch) {
return {
bindActionCreators({
fetchgadata: function(e) {
dispatch(onSetTimeRange(e.target.value));
}
}, dispatch)
};
}
If you want more function, you can simplify add to the bottom and keep chaining