Skip to content

Instantly share code, notes, and snippets.

@florentinH
Created May 22, 2018 08:03
Show Gist options
  • Save florentinH/cb3e4a75257e332cae1426981d10b47d to your computer and use it in GitHub Desktop.
Save florentinH/cb3e4a75257e332cae1426981d10b47d to your computer and use it in GitHub Desktop.
import React from 'react'
class SignUp extends React.Component {
constructor(props){
super(props)
this.updateEmailField = this.updateEmailField.bind(this)
this.state = { email: ''}
}
updateEmailField(event) {
this.setState({ email: event.target.value})
}
render() {
return (
<div>
<h1>{this.state.email}</h1>
<input type="email" name="email" value={this.state.email} onChange={this.updateEmailField}/>
</div>
)
}
}
export default SignUp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment