Created
April 15, 2019 13:20
-
-
Save benkissi/87abe7de23c37cb960ef5b2417446952 to your computer and use it in GitHub Desktop.
Context blog
This file contains 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
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