I'm using Searchbar component of your library.
I request to an API on clicking the searchbar icon
I want to clear searchValue state variable on clicking the close button on searchbar
what should i do?
Hi, @mmor93 You should just set your variable in state to empty string inside onIconPress callback. Does it work for you?
@Trancever
i will trigger the search function by onIconPress so i cant set my state to empty. i want to click on close button and set my state to empty.
Ok, so set this variable to empty inside onPress callback of button.
@Trancever
i cant because there is no props such onClosePress for Searchbar just onIconPress
Use onChangeText callback.