🎯 What you'll practice: useEffect's dependency array and cleanup pattern.
1-B 2-B 3-B 4-B | 5 = filter 6 = cleanup (returned) 7 = useEffect(()=>{fetch("/api/posts").then(r=>r.json()).then(setPosts);},[]); 8 = useEffect(()=>{const t=setInterval(tick,1000);return ()=>clearInterval(t);},[]); 9 = Without a dependency array the effect runs after every render; calling setState triggers another render, which re-runs the effect again — an infinite loop | 10 = Use [userId] — the effect re-runs only when userId itself changes, refetching for the new id without running on unrelated renders.