Created
May 1, 2019 21:59
-
-
Save gpDA/c1db4f5680aeaa911d768cdd28b611d0 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
// ./components/ButtonElement/buttonHandler.js | |
render() { | |
return ( | |
<div> | |
{/* show counter for each state change */} | |
<span>{this.count()}</span> | |
{/* increment button with value of counters `id` */} | |
<button className="buttonStyle" onClick={() => this.props.onIncrement(this.props.counter)}>line{this.props.counter.id}+</button> | |
{/* decrement button with value of counters `id` */} | |
<button className="buttonStyle" onClick={() =>this.props.onDecrement(this.props.counter)}>line{this.props.counter.id}-</button> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment