Logic Suite

React Challenge

Resolve structural state batches, stale closures, missing effect dependencies, and optimization render cycles.

Progress1 of 4 (25%)
React Statemedium

What is the final value of the 'count' state after the button click is processed?

Component.tsx
export default function Counter() {
  const [count, setCount] = useState(0);

  const handleClick = () => {
    setCount(count + 1);
    setCount(count + 1);
    setCount(count + 1);
  };

  return <button onClick={handleClick}>Count: {count}</button>;
}