useHeaderHeight does not update after cancelling search
Description
See https://github.com/react-navigation/react-navigation/issues/12331
Current behavior
useHeaderHeight() does not update its value when the search bar is closed
https://github.com/user-attachments/assets/7108eaa9-1ba1-4806-ac59-9b8d4910f704
Expected behavior
useHeaderHeight() should update to provide the adjusted height after the search bar is dismissed.
Steps to reproduce
- Click search bar
- Click "Cancel"
Snack or a link to a repository
https://snack.expo.dev/@c2thehris/useheaderheight-with-searchbar-ios-bug
Screens version
4.4.0
React Native version
0.76
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
None
Device model
No response
Acknowledgements
Yes
Thanks for the report! We'll look into this
Can confirm this issue.
Same issue with useAnimatedHeaderHeight,
I opened an issue on react navigation but I think I should have opened it here.
https://github.com/react-navigation/react-navigation/issues/12427