Instantly share code, notes, and snippets.

Embed
What would you like to do?
function App() {
const [count, setCount] = useState(0);
const [message, setMessage] = useState("");
function increment() {
setCount(count + 1);
setMessage(`count is ${count}`);
}
function decrement() {
setCount(count - 1);
setMessage(`count is ${count}`);
}
return (
<div className="App">
...
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment