Created
December 8, 2018 02:08
-
-
Save dance2die/a56bf566c110d0e74ac0696142ef8543 to your computer and use it in GitHub Desktop.
This file contains 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
function App() { | |
const [count, setCount] = useState(0); | |
const [message, setMessage] = useState(""); | |
function increment() { | |
setCount(count + 1); | |
} | |
function decrement() { | |
setCount(count - 1); | |
} | |
useEffect(() => setMessage(`count is ${count}`), [count, message]); | |
return ( | |
,,, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment