Skip to content

Instantly share code, notes, and snippets.

@benkissi
Created April 15, 2019 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benkissi/87abe7de23c37cb960ef5b2417446952 to your computer and use it in GitHub Desktop.
Save benkissi/87abe7de23c37cb960ef5b2417446952 to your computer and use it in GitHub Desktop.
Context blog
completed(id) {
const { todos } = this.state;
todos.forEach(todo => {
if (todo.id === id) {
todo.completed = !todo.completed;
}
});
this.setState({
todos: todos
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment