Created
December 30, 2017 23:44
-
-
Save dapperAuteur/5bdf1b036d3d5a45f892263c55f1f32c to your computer and use it in GitHub Desktop.
Egghead.com The Beginner's Guide To ReactJS Tutorial: Make Basic Forms With ReactJS
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
<script type="text/babel"> | |
class NameForm extends React.Component { | |
handleSubmit = event => { | |
event.preventDefault() | |
} | |
render() { | |
return ( | |
<form onSubmit={ this.handleSubmit }> | |
<label> | |
Name: | |
<input type="text" /> | |
</label> | |
<button type="submit">Submit</button> | |
</form> | |
) | |
} | |
} | |
ReactDOM.render( | |
<NameForm />, | |
document.getElementById('root'), | |
) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment