airair
All questions

How many times does the effect run

NewQuizReacteasy~2 minuseEffect, dependencies
function Page() {
  const [count, setCount] = useState(0);

  useEffect(() => {
    console.log("effect");
  }, []);

  return <button onClick={() => setCount(count + 1)}>{count}</button>;
}

After mounting and clicking the button three times, how many times has "effect" been logged?

Choose one answer