// ❌ LEAK: Accumulating in global cache const globalCache = []; function Component({ data }) { useEffect(() => { globalCache.push(data); // Never cleared }, [data]); } // ✅ CORRECT: Clear when unmounting function Component({ data }) { useEffect(() => { const index = globalCache.length; globalCache.push(data); return () => globalCache.splice(index, 1); }, [data]); } __ __