Replies: 5 comments
-
I see that UISearchController has a method called Would that be something that could be used?
My objc knowledge is limited but I tested the
Maybe it's something that could be included with the imperative api? #1523 |
Beta Was this translation helpful? Give feedback.
-
Hi @EvanBacon! Sorry for the late response 🙏 Cheers! |
Beta Was this translation helpful? Give feedback.
-
Hey @tboba export default function Search() {
const ref = useRef<SearchBarCommands>(null)
useEffect(() => {
console.log({ ref: ref.current })
ref.current?.setText("Hello world")
}, [])
return (
<>
<Stack.Screen options={{
title: "Search", headerSearchBarOptions: {
placeholder: "Type search",
ref: ref,
},
}}
/>
<Text>Hello world</Text>
</>
)
} The value doesn't get set and the ref is null in the log. any insights? |
Beta Was this translation helpful? Give feedback.
-
Also looking for an answer to this |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Is it possible to set the default value of the search bar? Something like:
{ headerSearchBarOptions: { placeholder: "Search", autoFocus: true, + value: 'incoming query' } }
Beta Was this translation helpful? Give feedback.
All reactions