Last active
April 23, 2021 12:54
-
-
Save joboccara/b30834dffc3e1c65ee77415b2018901c 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 Child = () => { | |
const { count, setCount } = React.useContext(CountContext); | |
return ( | |
<div> | |
<Button onClick={() => setCount((count) => count)}> | |
Call setCount from context with same value | |
</button> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment