-
-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expo - Unable to set default text for header search bar using ref #2392
Comments
Hi! Thanks for reporting the issue. Unfortunately, currently, I can only suggest using
On a side note - Screen component in the context of react-navigation (and expo-router) is a template on how to create a specific instance of a given screen, which can be pushed multiple times to the stack. So, passing ref to it might cause unexpected errors. I would suggest using:
inside screen content. I don't have much experience in using expo-router, but it looks like if you'd like to set some options on the screen like in your reproduction, you should do it in |
@Rezrazi i come up with another workaround, that could be better for your use-case:
Let me know if that solves your problem! |
thank you @maciekstosio hopefully the behavior becomes consistent in the next versions |
Description
When trying to imperatively set the text of the search bar input using a ref, it doesn't work as ref is always null on render.
Steps to reproduce
Snack or a link to a repository
https://github.com/Rezrazi/react-native-search-bar-minimal
Screens version
3.34.0
React Native version
0.75.4
Platforms
iOS
JavaScript runtime
None
Workflow
Expo managed workflow
Architecture
None
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 16 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: