Closed
Description
I was wondering why it is not possible to access state-derived props in mapDispatchToProps
. For instance, given the following mapStateToProps
function:
const mapStateToProps = (state, props) => {
return {
quota: state.quota,
};
};
I would like to access props.quota
in the corresponding mapDispatchToProps
:
const mapDispatchToProps = (dispatch, props) => {
return {
unlockItem(item_id) {
if (props.quota > 0) {
dispatch(unlockItem(item_id));
}
},
};
};
And if it is possible, how. Because I tried and could not. And I could not find anything about it in the documentation.
Metadata
Metadata
Assignees
Labels
No labels