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
This is a bit of an edge case and might be the logical expected behavior.
When adding two pointerleave events listeners to a ref interleaved with renders, the second pointerleave doesn't fire.
pointerleave.mov
The top square has a ref which gets two pointerenter and two pointerleave listeners that trigger a render by changing the component state. The listeners are added (and cleaned) on every render in a useEffect hook.
The bottom square has onPointerEnter and onPointerLeave props that also trigger a render by changing the component state.
As you can see from the video above, the behavior of the top square is different depending on whether the mouse exits to the background or to the bottom square.
This is a bit of an edge case and might be the logical expected behavior.
When adding two
pointerleaveevents listeners to a ref interleaved with renders, the secondpointerleavedoesn't fire.pointerleave.mov
The top square has a ref which gets two
pointerenterand twopointerleavelisteners that trigger a render by changing the component state. The listeners are added (and cleaned) on every render in auseEffecthook.The bottom square has
onPointerEnterandonPointerLeaveprops that also trigger a render by changing the component state.As you can see from the video above, the behavior of the top square is different depending on whether the mouse exits to the background or to the bottom square.
React version: 17.0.2
Steps To Reproduce
From the demo below:
Link to code example:
https://codesandbox.io/s/use-gesture-react-use-hover-bug-forked-gpr0r
The current behavior
When hovering the bottom square, the top square has
hovering1set tofalseandhovering2set totrue.The expected behavior
When hovering the bottom square, the top square should have both
hovering1andhovering2set tofalse.