Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created June 29, 2019 19:23
Show Gist options
  • Save jsmanifest/62d7081822c6adf2ee8902b5104cb60e to your computer and use it in GitHub Desktop.
Save jsmanifest/62d7081822c6adf2ee8902b5104cb60e to your computer and use it in GitHub Desktop.
const ShowMeTheMoney = () => {
const [money, setMoney] = useState(0)
const showThemTheMoney = (money) => {
setMoney(money)
}
const hideTheMoney = () => {
setMoney(null)
}
const sayWhereTheMoneyIs = (msg) => {
console.log(msg)
}
return (
<div>
<h4>Where is the money?</h4>
<hr />
<div style={{ display: 'flex', alignItems: 'center' }}>
<SomeCustomButton
type="button"
onClick={() => sayWhereTheMoneyIs("I don't know")}
>
I'll tell you
</SomeCustomButton>{' '}
<SomeCustomButton type="button" onClick={() => showThemTheMoney(0.05)}>
I'll show you
</SomeCustomButton>
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment