Skip to main content

Reset Button Feature

Edit the code below and use the Reset button to restore it!

Live Editor
function Counter() {
  const [count, setCount] = React.useState(0);
  
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>
        Increment
      </button>
    </div>
  );
}
Result
Loading...