In Redux, the calculation of the mergedProps depends on determining whether ownProps have changed. If ownProps change while shouldComponentUpdate is blocking the recalculation of mergedProps, a subsequent state update or propagation of seemingly unchanged ownProps (which appear the same as the last ownProps but differ from the ownProps before the blocking period) may result in incorrect mergedProps calculation. This issue arises because changes in ownProps during the blocking period are not taken into account.
Solution
This PR introduces a mechanism to detect changes in ownProps that occur while shouldComponentUpdate optimization is in effect. If such changes are detected during this blocking period, the next permitted component update will trigger a recalculation of mergedProps considering the updated ownProps.
Additional Information
For more details on how Redux calculates mergedProps and the role of areOwnPropsEqual in this process, please refer to the following link: Redux - selectorFactory.ts
Problem Description
In Redux, the calculation of the
mergedProps
depends on determining whetherownProps
have changed. IfownProps
change whileshouldComponentUpdate
is blocking the recalculation ofmergedProps
, a subsequent state update or propagation of seemingly unchangedownProps
(which appear the same as the lastownProps
but differ from theownProps
before the blocking period) may result in incorrectmergedProps
calculation. This issue arises because changes inownProps
during the blocking period are not taken into account.Solution
This PR introduces a mechanism to detect changes in
ownProps
that occur whileshouldComponentUpdate
optimization is in effect. If such changes are detected during this blocking period, the next permitted component update will trigger a recalculation ofmergedProps
considering the updatedownProps
.Additional Information
For more details on how Redux calculates
mergedProps
and the role ofareOwnPropsEqual
in this process, please refer to the following link: Redux - selectorFactory.ts