Created
April 17, 2018 02:25
-
-
Save ryanjyost/31ae0372cbf981d23a6750cf276d7288 to your computer and use it in GitHub Desktop.
updateInput() with localStorage
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
| updateInput(key, value) { | |
| // update react state | |
| this.setState({ [key]: value }); | |
| // update localStorage | |
| localStorage.setItem(key, value); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment