🎯 What you'll practice: useState for memory, useEffect for side effects, and the dependency array's role.
1-B 2-B 3-C 4-B | 5 = State 6 = dependency 7 = function Counter(){const [count,setCount]=useState(0);return <button onClick={()=>setCount(count+1)}>{count}</button>;} 8 = useEffect(()=>{fetch('/api/posts').then(r=>r.json()).then(setPosts);},[]); 9 = Without a dependency array, the effect re-runs after every render; if it calls setState, that triggers another render, which re-runs the effect again — an infinite loop | 10 = Use [userId] as the dependency array — the effect re-runs only when userId itself changes, refetching data for the new id without running on every unrelated render.