Created
May 19, 2020 15:00
-
-
Save brlafreniere/98f38a86369240b9d9d38962c20c5565 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
handleFieldValueChange = (event) => { | |
console.log(event.target.name) // displays the name of the field I'm typing in | |
this.setState({[event.target.name]: event.target.value}) | |
this.setState(prevState => { | |
console.log(event.target.name) // throws error: TypeError: Cannot read property 'name' of null | |
return {} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment