react-native-search-filter icon indicating copy to clipboard operation
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"

Open hussainhspl opened this issue 5 years ago • 4 comments

WhatsApp Image 2019-09-23 at 2 47 42 PM 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

hussainhspl avatar Sep 23 '19 09:09 hussainhspl

I also got this issue when update expo sdk from 33 to 35

khuongphp avatar Sep 28 '19 04:09 khuongphp

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.

ahmed-ismail-nt avatar Jan 10 '20 21:01 ahmed-ismail-nt

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

Makbar30 avatar May 28 '20 06:05 Makbar30

I did notice that if I change this from getDerivedStateFromProps() to UNSAFE_componentWillReceiveProps() it seems to work for my use case...

gina-shin avatar Nov 27 '23 00:11 gina-shin