Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Recipes extends React.Component {
  2.  constructor() {
  3.  super();
  4.  this.state = {
  5.  showEdit: false,
  6.  recipe: null
  7.  }
  8.  this.deleteItem = this.deleteItem.bind(this);
  9.  }
  10.  deleteItem() {
  11.  this.props.delete(this.props.recipe.name);
  12.  }
  13.  render() {
  14.  return (
  15.  <div>
  16.  <h3>
  17.  {this.props.recipe.name}
  18.  </h3>
  19.  <div>
  20.  <View recipe={this.props.recipe} editItem={this.props.editItem} >Edit</View>
  21.  <Button bsStyle=”danger” onClick={this.deleteItem}>Delete</Button>
  22.  </div>
  23.  </div>
  24.  );
  25.  }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement