Skip to content

Instantly share code, notes, and snippets.

@maylisdoucet
Last active May 14, 2018 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maylisdoucet/a945c800085c2fae29d91e9a622454e0 to your computer and use it in GitHub Desktop.
Save maylisdoucet/a945c800085c2fae29d91e9a622454e0 to your computer and use it in GitHub Desktop.
boîte email (fil rouge)
import React, { Component } from 'react';
import SignUp from './SignUp.js'
class App extends Component {
render() {
return (
<div>
<SignUp />
</div>
);
}
}
export default App;
import React, {Component} from 'react';
class SignUp extends Component {
constructor(props) {
super(props);
this.state = { email : 'Tape ton email' };
this.updateEmailField= this.updateEmailField.bind(this)
}
updateEmailField(event) {
this.setState({email: event.target.value});
}
render() {
return(
<div>
<h1>{this.state.email}</h1>
<input type="email" name="email" value={this.state.value} 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