Repository navigation
fix(presets): navigation link props, prevent-remove context, builder helpers and header height match React Navigation 7 - #865
Merged
Conversation
… ref methods and exports
…igateDeprecated and popTo match routers 7.6.5
…ated values, and Tabs and the flags have the package's shape (#717)
…ansition-progress # Conflicts: # packages/vitest-native/tests/screens-preset-surface.test.ts
…helpers and native-stack header height match React Navigation 7
…DefaultHeaderHeight follow the library's formula
…ck's header height
Owner
Author
…-gaps # Conflicts: # packages/vitest-native/src/presets/navigation.ts # packages/vitest-native/tests-native/conformance/native-stack.mock-waivers.json # packages/vitest-native/tests-native/conformance/native-stack.waivers.json # packages/vitest-native/tests-native/conformance/navigation.mock-waivers.json # packages/vitest-native/tests-native/conformance/navigation.waivers.json # packages/vitest-native/tests/presets.test.ts # packages/vitest-native/validation/bug-museum/exhibits.json
The merge of main brought back the branch's copy of it after the 0.15.1 version PR consumed it.
Open
3 tasks
Owner
Author
|
Adversarial review: PASS at e302ac2. Each #828 criterion has a test that fails on main, and the mocked shapes match the installed React Navigation 7 sources (native 7.5.1, core 7.24.0, elements 2.9.45, native-stack 7.21.0). The merge resolution and the single changeset are correct. Header-height gaps that predate or sit outside this change (platform read time, |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The navigation preset's
useLinkProps,usePreventRemoveContext,useNavigationBuilderand native-stackuseAnimatedHeaderHeightreturn what React Navigation 7 returns. Fixes #828.Why
useLinkProps()returnedaccessibilityRolewhere React Navigation 7.5 returnsrole.usePreventRemoveContext()returnednullwhere the library declares an object.useNavigationBuilder().navigationhad noemit.useAnimatedHeaderHeightwas missing from native-stack, so a screen using it failed with "is not a function".Changes
useLinkProps()returnsrole: "link".usePreventRemoveContext()returns the provided context, or an empty one.useNavigationBuilder().navigationis its own helpers object:useNavigation()'s mock functions plus anemitthat returns React Navigation's event object. It stays the same across renders.useAnimatedHeaderHeight()returns anAnimated.Valuefrom the engine's React Native (presets/active-react-native.ts), kept across renders. It starts where native-stack starts a card screen's header: 44 on an iOS phone, 56 on Android, with no top inset.useHeaderHeight()andHeaderHeightContext's default give that same height, as native-stack seeds its animated height from it.getDefaultHeaderHeight()from@react-navigation/elementsis the library's formula (platform, orientation, modal, status bar) instead of a constant 64.pre-828-native-stack-animated-header-height.Notes
useLinkPropschanges, and so does a test that expectednullfromusePreventRemoveContext().