Created
August 7, 2019 00:13
-
-
Save codingnninja/b53aa28ea2e15781bf15bb2240cdc81c to your computer and use it in GitHub Desktop.
Delete 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
deleteFoodItem(id) { | |
const foodItems = this.state.foodItems.filter( item => item.id !== id ); | |
this.setState({foodItems: foodItems}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment