Last active
April 23, 2021 12:54
-
-
Save joboccara/2f7562d65f2a2a7515824ed024c77455 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 + 1)}> | |
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