Description
Toggling header visibility simultaneous with StatusBar results in the header failing to show up again.
Initial state:

After calling navigation.setOptions({headerShown: false}); StatusBar.setHidden(true);:

After calling navigation.setOptions({headerShown: true}); StatusBar.setHidden(false);:

Cross-posted from react-navigation/react-navigation#13044 , as requested.
Steps to reproduce
- Start with the header and status bar both visible
navigation.setOptions({headerShown: false}); StatusBar.setHidden(true);
navigation.setOptions({headerShown: true}); StatusBar.setHidden(false);
- Notice that while the status bar is visible again (as expected), the header does not reappear (this is the bug)
Snack or a link to a repository
https://snack.expo.dev/@alpha0010/react-navigation-header-visibility-bug
Screens version
4.24.0
React Native version
0.84.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes
Description
Toggling header visibility simultaneous with
StatusBarresults in the header failing to show up again.Initial state:

After calling

navigation.setOptions({headerShown: false}); StatusBar.setHidden(true);:After calling

navigation.setOptions({headerShown: true}); StatusBar.setHidden(false);:Cross-posted from react-navigation/react-navigation#13044 , as requested.
Steps to reproduce
navigation.setOptions({headerShown: false}); StatusBar.setHidden(true);navigation.setOptions({headerShown: true}); StatusBar.setHidden(false);Snack or a link to a repository
https://snack.expo.dev/@alpha0010/react-navigation-header-visibility-bug
Screens version
4.24.0
React Native version
0.84.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
Android emulator
Device model
No response
Acknowledgements
Yes