Closed
Description
In #363 we were discussing a potential refactor, and in that refactor I came across some interesting behavior. The connect
function will default the mapStateToProps
and mapDispatchToProps
arguments if necessary. Here are the current conditions:
mapStateToProps
is defaulted todefaultMapStateToProps
when the argument is a falsy value.mapDispatchToProps
is defaulted todefaultMapDispatchToProps
when the argument isn't a function and is a falsy value.
My question is what is suppose to happen when we pass an invalid truthy value? And should we be making all invalid values default to the default values? One repercussion of not doing so it passing invalid values to wrapActionCreators
and then later to bindActionCreators
, which will result in that functions thrown error instead of our own error handling. Thoughts?
Metadata
Metadata
Assignees
Labels
No labels