Provider store the function mapDispatchToProps(this.myProp) in its state. Since there is no watcher, even if the provider update myProp, mapDispatchToProps is never recalculated inside the Provider.
We don't even need to store mapDispatchToProps. We can direclty call the prop mapDispatchToProps. In this way, if the prop change in the provider, the Provider will be updated with the good function.
when you use this pattern:
Provider store the function
mapDispatchToProps(this.myProp)
in its state. Since there is no watcher, even if the provider updatemyProp
,mapDispatchToProps
is never recalculated inside theProvider
.We don't even need to store mapDispatchToProps. We can direclty call the prop
mapDispatchToProps
. In this way, if the prop change in the provider, the Provider will be updated with the good function.