Fixing Stale Closures in React useCallback and useMemo Hooks
Stale closures are one of the sneakiest bugs in React. Your callback runs, the logic looks right, but it reads old state or props every single time. Here's how to diagnose and fix it for good.