toggleEdit() {
    // url: doesn't include the ?edit part
    const { url, isEditing, history } = this.props;
    const newUrl = isEditing ? url : url + '?edit';
    history.push(newUrl);
  }
// toggleEdit: change url to ?edit if not editing, and vice-versa
change url to ?edit if not editing, and vice-versa
change url to ?edit if not editing and vice - versa
toggleEdit() {
    const { url, isEditing, history } = this.props;
    const newUrl = isEditing ? url : url + '?edit';
    history.push(newUrl);
  }
toggleEdit ( ) { const { url , isEditing , history } = this . props ; const newUrl = isEditing ? url : url + '?edit' ; history . push ( newUrl ) ; }
toggleEdit: change url to ?edit if not editing, and vice-versa
toggleEdit : change url to ?edit if not editing and vice - versa
// url: doesn't include the ?edit part