Redux docs for bindActionCreators states that:
The only use case for
bindActionCreatorsis when you want to pass some action cre
More complete example, pass an object full of action creators to connect:
import * as ProductActions from './ProductActions';
// component part
export function Product({ name, description }) {
return
}
// container part
function mapStateToProps(state) {
return {...state};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators({
...ProductActions,
}, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Product);