Change full constructor to use class property, fix typo in handleChangeEmail, pass value to TextField to ensure they stay in sync.

This commit is contained in:
Lance Ruegger
2017-10-06 12:26:03 -07:00
parent 916596fe53
commit 252ec8f6ac
@@ -5,19 +5,15 @@ import {Button, TextField} from 'plugin-api/beta/client/components/ui';
import t from 'coral-framework/services/i18n';
class ForgotContent extends React.Component {
constructor() {
super();
this.state = {
value: '',
};
}
state = {value: ''};
handleSubmit = (e) => {
e.preventDefault();
this.props.fetchForgotPassword(this.state.value);
};
handleChangEmail = (e) => {
handleChangeEmail = (e) => {
const {value} = e.target;
this.setState({value});
}
@@ -39,7 +35,8 @@ class ForgotContent extends React.Component {
id="email"
name="email"
label={t('sign_in.email')}
onChange={this.handleChangEmail}
onChange={this.handleChangeEmail}
value={this.state.value}
/>
</div>
<Button