react-native-search-filter
react-native-search-filter copied to clipboard
"Value" prop is declared by you, when we try to assign value it shows error "this.updateSearch is not a function"
I have using two search input on same page and i want to reset both input on a single reset button click. So i am trying to assign empty state to search input using value prop. Is there any other solution available ? Please Help
Thank you
I also got this issue when update expo sdk from 33 to 35
If you're getting this error because you're still using the hacky workaround of setting value
and then clearing it when the clearIcon
is pressed, then try using the defaultValue
prop instead of value
.
For me, i fix it with this way Go to your node-modules/react-native-search-filter/src/index.js Comment function getDerrivedStateFromProps because when i console.log the value, it value all undefined although i pass a value as props , so const e is undefined
Sorry for my bad english Hope can fix this issue
I did notice that if I change this from getDerivedStateFromProps()
to UNSAFE_componentWillReceiveProps()
it seems to work for my use case...