I don't need mapStateToProps in my component, but I need mapDispatchToProps -
const mapDispatchToProps = dispatch =>
({
myCallBack(passFunc, passDirFunc) {
dispatch(
actions.setSideNavAction(passFunc, passDirFunc)
)
}
})
If I completely remove mapStateToProps and use connect as -
export default connect(mapDispatchToProps)(Application);
then get an error - unclean (in promise) TypeError: sending is not a function.
Be sure to keep empty mapStateToProps.
const mapStateToProps = state =>
({
})
Please clarify.
source
share