Created
November 29, 2018 19:42
-
-
Save Jahans3/07bb5fef1455317dcce9cd56db497474 to your computer and use it in GitHub Desktop.
Consuming State
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
import { StateConsumer } from './stateContext'; | |
export default function SomeCount () { | |
return ( | |
<StateConsumer> | |
{state => ( | |
<p> | |
Count: {state.count} | |
</p> | |
)} | |
</StateConsumer> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment