Created
April 30, 2019 16:17
-
-
Save abhishekjakhar/f711174d9eb79920f00763b00936bc88 to your computer and use it in GitHub Desktop.
updateMocktail Method
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
updateMocktail = mocktail => { | |
const newMocktail = mocktail; | |
this.setState(state => { | |
if (state.mocktail === newMocktail) { | |
return null; | |
} else { | |
return { mocktail }; | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment