Skip to content

Instantly share code, notes, and snippets.

@phsantiago
Created January 3, 2019 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phsantiago/74486182a45b104d4868390cc4bbcb89 to your computer and use it in GitHub Desktop.
Save phsantiago/74486182a45b104d4868390cc4bbcb89 to your computer and use it in GitHub Desktop.
import { useState } from 'react';
function Gato() {
const [idade, setIdade] = useState(3);
return (
<div>
<p>Este gato tem {idade} anos</p>
<button onClick={() => setIdade(count + 1)}>
Clique aqui para envelhecer o bixano
</button>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment