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
fix(useViewportEffect): support changing recalculateLayoutBeforeUpdate in combination with deferUpdateUntilIdle
When recalculateLayoutBeforeUpdate is used with a dynamic value in a
function, e.g. useRect, the function is not reassninged to the listener.
This can especially become an issue with deferUpdateUntilIdle.
In the example of useRect, the deferred function will be called with the
old element (which might be null) and the update which is triggered
afterwards containing the new function is not respected any longer.
Afterwards the dependency is not changing any longer, therefore the
state stays undefined.
Using a dynamic function that calls the latest function independent of
when it was registered fixes the issue.
Closes#16
0 commit comments