Update ReactBasics.md

master
Matt Huntington 8 years ago committed by GitHub
parent 078a3284dc
commit d3fd80b096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -622,6 +622,17 @@ The previous section for updating state can often be overly complex when dealing
1. Replace handleChangeName with a form submission handler that references the text input
```HTML
<form onSubmit={this.handleFormSubmit}>
{this.state.username}
<input
ref="username"
type="text"
placeholder="Your Name"/>
<input type="submit" value="Log In"/>}
</form>
```
```JavaScript
handleFormSubmit(event){
event.preventDefault();

Loading…
Cancel
Save