Skip to content

Navigation preset: header height ignores platform changes, providers and the safe-area inset #889

Open

Description

@danfry1

The navigation preset's header-height values differ from React Navigation 7 in three ways that #865 left as they were:

  • HeaderHeightContext's default is computed once when the elements factory runs, so setPlatform("android") after import leaves the context at 44 while useHeaderHeight() returns 56. useHeaderHeight also ignores a HeaderHeightContext.Provider, which React Navigation 7 reads.
  • The default header height uses a top inset of 0. React Navigation's NativeStackView adds insets.top, and the mock engine's safe-area fallback reports 47, so a test sees 44 where the app shows 91.
  • useAnimatedHeaderHeight returns a bare Animated.Value. React Navigation 7 returns an Animated.add(...) result read from AnimatedHeaderHeightContext, and throws outside a screen.

Acceptance criteria

  • HeaderHeightContext's default follows the active platform at read time, and useHeaderHeight reads a provided HeaderHeightContext value; a test covers each.
  • The default header height includes the safe-area top inset the preset reports, or the docs state why it does not; a test pins the chosen value.
  • useAnimatedHeaderHeight reads AnimatedHeaderHeightContext when provided; a test covers it.

Activity

  1. added this to the 0.16.0 milestone on Nov 15, 2026
  2. added
    bug
    area:presets
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:presetsbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions