Skip to content

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

@alpha0010

Description

@alpha0010

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 react-navigation/react-navigation#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:androidIssue related to Android part of the libraryrepro-providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions