Skip to content

fix(iOS, Stack v5): Refactor header coordination to hide header when no headerConfig is provided - #4535

Open
kmichalikk wants to merge 1 commit into
mainfrom
@kmichalikk/stack-v5-hide-header-when-no-config
Open

fix(iOS, Stack v5): Refactor header coordination to hide header when no headerConfig is provided#4535
kmichalikk wants to merge 1 commit into
mainfrom
@kmichalikk/stack-v5-hide-header-when-no-config

Conversation

@kmichalikk

@kmichalikk kmichalikk commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Closes https://github.com/software-mansion/react-native-screens-labs/issues/1699

Description

Currently on v5 when no headerConfig is provided native header is rendered empty, with back button present. Additionally, the header is set to large variant by default, and that looks bad. This PR hides the header entirely when no config is provided, matching the behavior in v4.

Changes

  • moved the header coordinator wiring header config earlier so we can catch the fact when screen viewWillAppear fires
  • added method for setting header visibility
  • added screen.viewWillAppear that hides the header if no config provider is present

Before & after - visual documentation

n/a

Test plan

Use simple navigation SFT, hide the header on one screen and navigate; use test-stack-header-subviews-ios, hide / show the header via prop updates. Verify that it hides.

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

@kmichalikk
kmichalikk marked this pull request as draft August 21, 2026 08:35
@kmichalikk
kmichalikk force-pushed the @kmichalikk/stack-v5-hide-header-when-no-config branch from 44a02fe to 8cebc2f Compare August 21, 2026 13:04
@kmichalikk kmichalikk changed the title fix(iOS, Stack v5): Hide header when no headerConfig is provided fix(iOS, Stack v5): Refactor header coordination to hide header when no headerConfig is provided Aug 21, 2026
@kmichalikk
kmichalikk marked this pull request as ready for review August 21, 2026 13:41
@kmichalikk
kmichalikk requested review from kligarski and t0maboro and a balanced review from Copilot and removed request for kligarski August 21, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors iOS Stack v5 header coordination so screens without a header configuration hide the native navigation bar, matching v4 behavior.

Changes:

  • Wires header coordinators during child mounting.
  • Updates navigation-bar visibility during screen appearance and configuration changes.
  • Clears header coordinator resources when configurations unmount.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ios/stack/screen/RNSStackScreenHeaderCoordinator.mm Centralizes navigation-bar visibility handling.
ios/stack/screen/RNSStackScreenHeaderCoordinator.h Exposes the visibility update method.
ios/stack/screen/RNSStackScreenController.mm Updates visibility before screen appearance.
ios/stack/screen/RNSStackScreenComponentView.mm Wires and clears header coordination during mounting.
ios/stack/header/RNSStackHeaderConfigComponentView.mm Uses the coordinator assigned by the parent screen.
ios/stack/header/RNSStackHeaderConfigComponentView.h Adds the weak coordinator property.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants