From 252ec8f6ac3aced465ed53de262b150fe7ac6d3a Mon Sep 17 00:00:00 2001 From: Lance Ruegger Date: Fri, 6 Oct 2017 12:26:03 -0700 Subject: [PATCH] Change full constructor to use class property, fix typo in handleChangeEmail, pass value to TextField to ensure they stay in sync. --- .../client/components/ForgotContent.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/talk-plugin-auth/client/components/ForgotContent.js b/plugins/talk-plugin-auth/client/components/ForgotContent.js index 49692abbb..d8ae2fab0 100644 --- a/plugins/talk-plugin-auth/client/components/ForgotContent.js +++ b/plugins/talk-plugin-auth/client/components/ForgotContent.js @@ -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} />