ReactStudyKit

Find the Bug Game

Question 1 of 26REACT

What's the bug in this React counter component?


  function Counter() {
    const [count, setCount] = useState(0);
  
    const increment = () => {
      setCount(count + 1);
      setCount(count + 1);
    };
  
    return (
      <div>
        <p>Count: {count}</p>
        <button onClick={increment}>
          Increment
        </button>
      </div>
    );
  }
Score: 0/26