Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. completed(id) {
  2. const { todos } = this.state;
  3. todos.forEach(todo => {
  4. if (todo.id === id) {
  5. todo.completed = !todo.completed;
  6. }
  7. });
  8. this.setState({
  9. todos: todos
  10. });
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement