mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All step mutation callbacks (addStep, removeStep, moveStep, updateStepSettings) captured `steps` in their useCallback closures. When React batched state updates, rapid interactions could use a stale steps array, causing clicks to silently fail. Fix: use a stepsRef that always holds the latest value. Callbacks read from stepsRef.current instead of the captured closure variable, and no longer need `steps` in their dependency arrays.