React Native [React Native Elements] Search Bar CancelButtonText

React-Native - IOS - React-Native (0.53.0) - React-Native-Elements ("^.19.0")

I am having trouble displaying the 'Cancel' button next to my React-Native-Element Search Bar when user selects search bar. Image provided of what I am trying to achieve

Here is my code snippet :

    <SearchBar
         lightTheme round
         placeholder="Test"
         onSubmitEditing={()=>{this.doSomething()}}
         cancelButtonText = "Cancel"
     />

Reference for React-Native-Element Search Bar https://react-native-training.github.io/react-native-elements/docs/searchbar.html

The docs are different for the latest stable release and the beta release.

If you have beta releese, you may add cancelButtonTitle prop to your SearchBar

<SearchBar
  showLoading
  platform="ios"
  cancelButtonTitle="Cancel"
  placeholder='Search' />

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue