Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
render() {
const items = [1, 2, 3, 4, 5].map((id, i) => {
return (
<div key={id} onClick={() => this.handleClick(i)}>
<Child id={id} isClicked={this.state.clicked[i]} />
</div>
);
});
return (
<div>
<div>{items}</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.