diff --git a/native/components/clearable-text-input.react.js b/native/components/clearable-text-input.react.js --- a/native/components/clearable-text-input.react.js +++ b/native/components/clearable-text-input.react.js @@ -16,12 +16,13 @@ onChangeText: (inputText: string) => void = inputText => { let text; + const { lastMessageSent } = this; if ( - this.lastMessageSent && - this.lastMessageSent.length < inputText.length && - inputText.startsWith(this.lastMessageSent) + lastMessageSent && + lastMessageSent.length < inputText.length && + inputText.startsWith(lastMessageSent) ) { - text = inputText.substring(this.lastMessageSent.length); + text = inputText.substring(lastMessageSent.length); } else { text = inputText; this.lastMessageSent = null;