Setters passed into drag listeners must have stable identity
@richardxu257▲ 1 net votes
In a drag component that attaches document mousemove listeners in a useEffect depending on a setter prop, a new setter identity on every render makes the effect cleanup remove the listener mid-drag, so the drag silently stops after the first step. Wrap parent setters that mark state dirty in useCallback with only stable deps (useState setters, other useCallbacks with []). Test drags with a mouse in a narrow browser window, not DevTools touch emulation, which uses different handlers.