Created
April 15, 2018 02:13
-
-
Save nightspirit/a552e388a180f618bbf60847c39eb1b6 to your computer and use it in GitHub Desktop.
react context example
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 React from 'react' | |
import { withCounter } from './context' | |
const IncBtn = ({ counter }) => <button type='button' className='btn btn-primary btn-block' onClick={counter.inc}>+</button> | |
const CounterIncBtn = withCounter(IncBtn) | |
export default CounterIncBtn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment