diff --git a/src/common/InputWithClearButton.js b/src/common/InputWithClearButton.js index 877e1961943..e1fc4aa38af 100644 --- a/src/common/InputWithClearButton.js +++ b/src/common/InputWithClearButton.js @@ -17,7 +17,6 @@ const componentStyles = createStyleSheet({ type Props = $ReadOnly<$Diff>; type State = {| - canBeCleared: boolean, text: string, |}; @@ -29,7 +28,6 @@ type State = {| */ export default class InputWithClearButton extends PureComponent { state = { - canBeCleared: false, text: '', }; // We should replace the fixme with @@ -40,7 +38,6 @@ export default class InputWithClearButton extends PureComponent { handleChangeText = (text: string) => { this.setState({ - canBeCleared: text.length > 0, text, }); if (this.props.onChangeText) { @@ -57,7 +54,7 @@ export default class InputWithClearButton extends PureComponent { }; render() { - const { canBeCleared, text } = this.state; + const { text } = this.state; return ( @@ -67,7 +64,7 @@ export default class InputWithClearButton extends PureComponent { onChangeText={this.handleChangeText} value={text} /> - {canBeCleared && ( + {text.length > 0 && (