Skip to content

Instantly share code, notes, and snippets.

@15Dkatz
Created January 27, 2019 21:55
Show Gist options
  • Save 15Dkatz/3e6254d26d7dbeebc0b0f0c822baee60 to your computer and use it in GitHub Desktop.
Save 15Dkatz/3e6254d26d7dbeebc0b0f0c822baee60 to your computer and use it in GitHub Desktop.
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