software-mansion / software-mansion/react-native-screens

[Android] Header fails to render when visibility is changed simultaneous with StatusBar

Open
#3,795 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform:android repro-provided
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:
Image

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

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

Cross-posted from https://github.com/react-navigation/react-navigation/issues/13044 , as requested.

Steps to reproduce
  1. Start with the header and status bar both visible
  2. navigation.setOptions({headerShown: false}); StatusBar.setHidden(true);
  3. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.