Created
May 1, 2019 21:53
-
-
Save gpDA/f1b95d185de721e83b60a66fba84b69d 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/counter.js | |
class Counters extends Component{ | |
render(){ | |
return ( | |
<div> | |
{/* map will run 3 times and | |
make 3 ButtonHandlers */} | |
{this.props.counters.map(counter => ( | |
<ButtonHandler | |
key={counter.id} | |
onIncrement={this.props.onIncrement} | |
onDecrement={this.props.onDecrement} | |
counter={counter} | |
/> | |
))} | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment