You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have local message state const [message, onChangeMessage] = useState('')
Value of message changes by input. When i send message i need to clear input and forbid type new value without disabling the input field (because disable state makes keyboard close, but it must be always open)
I can do this with TextInput from react native by passing in props this onChangeText function
onChangeText={
val => {
if (!isSending) {
inputRef.current.clear() // clear input by ref
onChangeMessage('') // clear massage state
} else {
onChangeMessage(val)
}
It prevents typing new text in input while prev message is sending.
But if i pass same function to onChange prop of mention input it not works and i still can type text and change input's value. In the same time local message state not changes, it is empty string while is sending
The text was updated successfully, but these errors were encountered:
I have local message state
const [message, onChangeMessage] = useState('')
Value of message changes by input. When i send message i need to clear input and forbid type new value without disabling the input field (because disable state makes keyboard close, but it must be always open)
I can do this with TextInput from react native by passing in props this onChangeText function
It prevents typing new text in input while prev message is sending.
But if i pass same function to onChange prop of mention input it not works and i still can type text and change input's value. In the same time local message state not changes, it is empty string while is sending
The text was updated successfully, but these errors were encountered: