Last active
August 7, 2019 00:58
-
-
Save codingnninja/6de462948361f56fd43cc238b97a0a5a to your computer and use it in GitHub Desktop.
Edit food items.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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