Skip to content

Instantly share code, notes, and snippets.

@jokamjohn
Created May 17, 2018 08:23
Show Gist options
  • Save jokamjohn/f8277af80d37e3ff31efb40aa72a207f to your computer and use it in GitHub Desktop.
Save jokamjohn/f8277af80d37e3ff31efb40aa72a207f to your computer and use it in GitHub Desktop.
toggleItemEditing = index => {
this.setState({
items: this.state.items.map((item, itemIndex) => {
if (itemIndex === index) {
return {
...item,
isEditing: !item.isEditing
}
}
return item;
})
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment