Created
February 24, 2018 17:14
-
-
Save codewithbernard/40b15b81d271d47c4b18cc7a24d28d66 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| handleSubmit = (event) => { | |
| event.preventDefault() | |
| const meal = this.state.meal; | |
| if (this.state.meals.indexOf(meal) === -1) { | |
| this.setState({ | |
| meals: [...this.state.meals, meal], | |
| meal: "" | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment