Last active
August 21, 2020 01:22
-
-
Save diego-miranda-ng/3dc2f3f0305a24f9f9945e2a56a9a146 to your computer and use it in GitHub Desktop.
Exemplo da utilização do hook useState para lidar com estados em um componente de função.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
export default App = (props) => { | |
const [count, setCount] = useState(0); | |
return <button onClick={() => setCount(count + 1)}>{count}</button>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment