Skip to content

Instantly share code, notes, and snippets.

@codingnninja
Last active August 7, 2019 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingnninja/6de462948361f56fd43cc238b97a0a5a to your computer and use it in GitHub Desktop.
Save codingnninja/6de462948361f56fd43cc238b97a0a5a to your computer and use it in GitHub Desktop.
Edit food items.
editFoodItem(foodItem) {
this.setEditing(true);
this.setState({
food:foodItem.food,
cost:foodItem.cost,
foodItem: foodItem
});
}
setEditing(value) {
if(typeof value !== 'boolean') { throw " This value must either be true or false"}
this.setState({
editing: value
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment