-
-
Save franleplant/30c25cb62aca99a1ad3098ba06130304 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 Form extends React.Component { | |
constructor(props) { | |
this.state = { | |
name: '', | |
email: '' | |
} | |
} | |
handleNameChange(e) { | |
this.setState({ | |
name: e.target.value | |
}) | |
} | |
handleEmailChange(e) { | |
this.setState({ | |
email: e.target.value | |
}) | |
} | |
render() { | |
return( | |
<form> | |
<input value={this.state.name} onChange={this.handleNameChange} /> | |
<input value={this.state.email} onChange={this.handleEmailChange} /> | |
</form> | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment