Open nickngn opened 6 years ago
I encountered the same error but not for the same reason. I found it by noticing that the response of findNodeHandle
was null, instead of a number. Probably, react-native-text-input-reset should do some validation.
In your case, I think you want to make sure you're actually saving the ref of the TextInput instead of using the element as a value:
<TextInput
ref={inputRef => { this.inputRef = inputRef; }}
// ...
/>
// ...
TextInputReset.resetKeyboardInput(findNodeHandle(this.inputRef));
Hi! I'm no longer maintaining this since the issue for my apps was solved in more recent versions of React Native. However, I'd be happy to merge a pull request and update npm if there's a fix for the issue.
Hmmm, looking back at the issues over in React Native it seems that it really hasnt been solved for a lot of devices. So yeah, if this package can still provide a workaround I'll be happy to merge PRs. 😄
I was trying to use your package to solve my issue: the text is duplicated when input in some Samsung devices. I declare a in constructor:
Then, I call it in a function:
And use your function to reset in conponentDidMount():
But when I run project, it invokes the error:
Hope you reply me soon.. :))