Skip to content

Instantly share code, notes, and snippets.

@chentsulin
Created November 5, 2018 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chentsulin/ddbd8c584c7b83c7e3547f095cc5d3aa to your computer and use it in GitHub Desktop.
Save chentsulin/ddbd8c584c7b83c7e3547f095cc5d3aa to your computer and use it in GitHub Desktop.
counter powerplug
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