Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created July 28, 2018 15:44
Show Gist options
  • Select an option

  • Save dance2die/bdf5546e36fa6b707399152a6476b389 to your computer and use it in GitHub Desktop.

Select an option

Save dance2die/bdf5546e36fa6b707399152a6476b389 to your computer and use it in GitHub Desktop.
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