Skip to content

SearchBar text prop #676

Feb 24, 2023 · 1 comments · 13 replies
Discussion options

You must be logged in to vote

Hey @salisuabubakar. Thank you so much. You’ve really put a smile on my face. I’m surprised you only saw a 30% improvement ;)

The text prop works the same as the value prop on the React Native TextInput component. You need useState to hold the text.

const [text, onChangeText] = useState('');

<SearchBar
  text={text}
  onChangeText={onChangeText}>
</SearchBar>

There’s a zoom sample that shows the SearchBar in action. I’ve recently updated the SearchBar component to support the Material 3 Search Bar from android. If you want to take advantage of this, like in the zoom sample, then you should update to the latest navigation-react-native and use a Material 3 Theme.

Any questions let me know.…

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@salisuabubakar
Comment options

@grahammendick
Comment options

@grahammendick
Comment options

@salisuabubakar
Comment options

@grahammendick
Comment options

Answer selected by salisuabubakar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants