Appease the linter

This checks `onValidate` in `render` to make the linter happy.
This commit is contained in:
J. Ryan Stinnett 2019-03-07 14:34:55 +00:00
parent b8925d857d
commit 7241418eba

View file

@ -95,10 +95,13 @@ export default class Field extends React.PureComponent {
prefixContainer = <span className="mx_Field_prefix">{prefix}</span>;
}
const validClass = classNames({
mx_Field_valid: this.state.valid === true,
mx_Field_invalid: this.state.valid === false,
});
let validClass;
if (onValidate) {
validClass = classNames({
mx_Field_valid: this.state.valid === true,
mx_Field_invalid: this.state.valid === false,
});
}
const fieldClasses = classNames("mx_Field", `mx_Field_${inputElement}`, {
// If we have a prefix element, leave the label always at the top left and