You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #21 I found that the selectStateProps functions that are passed to useSelector, currently, get executed twice for each relevant key change. This is due to useSelector (which is already reading state using useState) always calling it once and the callback given to the store proxy calling it to detect changes; if changes are found, the callback sets the state resulting in the entire selectStateProps function to be executed again.
This should be fixed such that for each relevant store key change, selectStateProps is only called once.
The impact is probably not that huge since the return value of the two selectStateProps calls will always be the same, causing React to only trigger (at most) one rerender.
The text was updated successfully, but these errors were encountered:
I want to note here that my idea for solving this did not work and after extensive consideration I did not come up with a way to avoid these calls while at the same time causing all necessary updates to happen and without causing unnecessary rerenders.
Since the impact of this issue is not that big, I will prioritize others first.
While working on #21 I found that the
selectStateProps
functions that are passed touseSelector
, currently, get executed twice for each relevant key change. This is due touseSelector
(which is already reading state usinguseState
) always calling it once and the callback given to the store proxy calling it to detect changes; if changes are found, the callback sets the state resulting in the entireselectStateProps
function to be executed again.This should be fixed such that for each relevant store key change,
selectStateProps
is only called once.The impact is probably not that huge since the return value of the two
selectStateProps
calls will always be the same, causing React to only trigger (at most) one rerender.The text was updated successfully, but these errors were encountered: