Created
October 25, 2018 22:01
-
-
Save Calvein/59ed5a9a56ad9a6461c9775923ad7349 to your computer and use it in GitHub Desktop.
Toggle component usage
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
let Component = () => { | |
return ( | |
<> | |
<Toggle defaultIsOn> | |
{({ isOn, toggle }) => ( | |
<button onClick={toggle}> | |
is {isOn ? 'on' : 'off'} | |
</button> | |
<Modal isOpen={isOn}> | |
Hello | |
</Modal> | |
)} | |
</Toggle> | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment