Created
November 5, 2018 15:25
-
-
Save chentsulin/ddbd8c584c7b83c7e3547f095cc5d3aa to your computer and use it in GitHub Desktop.
counter powerplug
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
import { Counter as PCounter } from 'react-powerplug' | |
const Counter = ({ defaultValue }) => { | |
return ( | |
<PCounter initial={defaultValue}> | |
{({ count, inc }) => ( | |
<> | |
<div>{count}</div> | |
<button onClick={inc}>+</button> | |
</> | |
)} | |
</PCounter> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment