Fix Log-in Outside Lighthouse Crash The App

Summary:
The `error` was not recognized as a string and React was not happy about it.

Change the `error` to a string explicitly. Also, add space between the error and the form box.

Reviewed By: jknoxville

Differential Revision: D18829862

fbshipit-source-id: 0474d411a95bab4bc4f62a3f3d3839029938a9e6
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-12-05 05:43:40 -08:00
committed by Facebook Github Bot
parent 186af77f62
commit 94ce34066b

View File

@@ -80,7 +80,7 @@ class SignInSheet extends Component<Props, State> {
this.props.onHide();
} catch (error) {
console.error(error);
this.setState({token: '', loading: false, error});
this.setState({token: '', loading: false, error: `${error}`});
}
}
};
@@ -103,6 +103,7 @@ class SignInSheet extends Component<Props, State> {
value={this.state.token}
onChange={e => this.setState({token: e.target.value})}
/>
<br />
{this.state.error && (
<InfoText color={colors.red}>
<strong>Error:</strong>&nbsp;{this.state.error}