Skip to content

Instantly share code, notes, and snippets.

@amcginlay
Last active June 26, 2020 15:18
Show Gist options
  • Save amcginlay/439921c5beb80c156fe19a7b1726dfb2 to your computer and use it in GitHub Desktop.
Save amcginlay/439921c5beb80c156fe19a7b1726dfb2 to your computer and use it in GitHub Desktop.
function Button() {
const [counter, setCounter] = useState(0);
return <button onClick={() => setCounter(counter+1)}>{counter}</button>;
}
ReactDOM.render(
<Button />,
document.getElementById('mountNode'),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment