Created
June 29, 2019 19:23
-
-
Save jsmanifest/62d7081822c6adf2ee8902b5104cb60e to your computer and use it in GitHub Desktop.
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
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