Created
January 27, 2019 21:55
-
-
Save 15Dkatz/3e6254d26d7dbeebc0b0f0c822baee60 to your computer and use it in GitHub Desktop.
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
class App extends React.Component { | |
state = { userText: '' }; | |
updateUserText = event => { | |
this.setState({ userText: event.target.value }); | |
console.log('current userText', this.state.userText); | |
} | |
render() { | |
return ( | |
<div> | |
<h2>Type Race</h2> | |
<input value={this.state.userText} onChange={this.updateUserText} /> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment