Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created December 8, 2018 02:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/a56bf566c110d0e74ac0696142ef8543 to your computer and use it in GitHub Desktop.
Save dance2die/a56bf566c110d0e74ac0696142ef8543 to your computer and use it in GitHub Desktop.
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