Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- completed(id) {
- const { todos } = this.state;
- todos.forEach(todo => {
- if (todo.id === id) {
- todo.completed = !todo.completed;
- }
- });
- this.setState({
- todos: todos
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement