Created
May 22, 2019 05:49
-
-
Save js2me/d518bf72d6fc53c5b2c960843d4ac623 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 Login extends React.Component { | |
changeForm = ({ target }) => { | |
this.setState({ [target.name]: target.value }) | |
} | |
render() { | |
const { firstName, lastName } = this.state | |
return ( | |
<div> | |
<input value={firstName} name="firstName" onChange={this.changeForm} /> | |
<input value={lastName} name="lastName" onChange={this.changeForm} /> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment