src/app/App.js
/*
  = callback function =
  this function gets passed through <TodoForm /> to <TodoItem /> where it is called by its onClick event handler; allows us to update the `completed` state 
  */
callback function
this function gets passed through  to  where it is called by its onClick event handler; allows us to update the `completed` state
callback function this function gets passed through to where it is called by its onClick event handler ; allows us to update the ` completed ` state
markItem(id, isCurrentlyCompleted) {
    let newCompleted;
    if (isCurrentlyCompleted) {
      newCompleted = this.state.completed.filter(itemId => itemId !== id);
    } else {
      newCompleted = this.state.completed.concat([id]);
    }
    this.setState({ completed: newCompleted });
  }
markItem ( id , isCurrentlyCompleted ) { let newCompleted ; if ( isCurrentlyCompleted ) { newCompleted = this . state . completed . filter ( itemId => itemId !== id ) ; } else { newCompleted = this . state . completed . concat ( [ id ] ) ; } this . setState ( { completed : newCompleted } ) ; }
callback function
this function gets passed through <TodoForm /> to <TodoItem /> where it is called by its onClick event handler; allows us to update the `completed` state
callback function this function gets passed through <TodoForm / > to <TodoItem / > where it is called by its onClick event handler ; allows us to update the ` completed ` state