software-mansion / software-mansion/react-native-screens
[Android] Header fails to render when visibility is changed simultaneous with StatusBar
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 714
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 71
Description
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 https://github.com/react-navigation/react-navigation/issues/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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked Snack and reproducing the sequence with Android, Fabric, React Native 0.84.1, and Hermes. Trace the Android header visibility and StatusBar transitions involved in the two setOptions/StatusBar.setHidden pairs. Done means the header reappears after both are made visible again, while the existing reproduction remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100