Created
April 16, 2019 08:59
-
-
Save MeetMartin/ec997d8ef48eb6a7b20e10c7a8e5005c 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
// src/components/MyComponent.js | |
import React, {useContext} from 'react'; | |
import {StoreContext} from '../store/StoreContext'; | |
const MyComponent = () => { | |
const {state, actions} = useContext(StoreContext); | |
return( | |
<button onClick={() => actions.triggerAction('data')}>Click me</button> | |
) | |
}; | |
export default MyComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment