chore(navigation): replace JS stack router with native-stack - #1337
Draft
hgray-instawork wants to merge 4 commits into
Draft
chore(navigation): replace JS stack router with native-stack#1337hgray-instawork wants to merge 4 commits into
hgray-instawork wants to merge 4 commits into
Conversation
hgray-instawork
force-pushed
the
hardin/navigation-native-stack
branch
6 times, most recently
from
August 25, 2026 20:29
58d342c to
9e2d177
Compare
hgray-instawork
force-pushed
the
hardin/navigation-native-stack
branch
from
August 27, 2026 17:37
958596b to
4d05314
Compare
hgray-instawork
force-pushed
the
hardin/navigation-native-stack
branch
6 times, most recently
from
September 1, 2026 10:13
fd4c274 to
a8d1776
Compare
Add the native-stack package to the library and demo dependency sets so consumers can opt into native routes.
Render stack navigators with native-stack behind an opt-in flag while preserving the existing stack implementation by default.
Keep back behaviors, modal ownership, and nested navigation aligned with the existing stack when native routes are enabled.
Run navigation sequences through stack and native-stack and cover the modal, back, event, and nested-route regressions found in device testing.
hgray-instawork
force-pushed
the
hardin/navigation-native-stack
branch
from
September 1, 2026 10:15
a8d1776 to
0ae08ed
Compare
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
@react-navigation/stackwith@react-navigation/native-stackwhile preserving Hyperview's navigator and HXML APIs.trigger="back"interception with React Navigation's prevent-remove hook.enableModalDismissGestureas an opt-in top-levelHyperviewprop for native iOS modal presentation and swipe-to-dismiss gestures.Why
Native stack handles transitions and route removal differently from the JavaScript stack. The migration exposed three behaviors that required explicit handling:
newroutes need modal/sub-stack state so pushes within a modal stay in that modal's navigator.beforeRemovelistener. Back-trigger behaviors needusePreventRemoveinstead.Navigation behavior
Dynamic and nested modals
newactions to open another modal.newroutes as both modal and sub-stack routes so pushing a screen from inside a modal works on iOS and Android.Back-trigger prevention
Back behaviors now use the React Navigation prevent-remove hook instead of calling
preventDefault()frombeforeRemove. This allows a visibletrigger="back"behavior to block route removal from back actions and native gestures, run its configured behavior, and allow a later removal once the behavior is gone.The compatibility layer selects:
UNSTABLE_usePreventRemovewith the currently supported React Navigation 6 packages.usePreventRemovewhen the stable React Navigation 7 export is available.The existing back-behavior registry is now reactive because the hook must know whether removal is prevented before navigation begins.
Modal presentation and gestures
The new optional
enableModalDismissGestureprop controls the native iOS modal experience:falseor omitted): modal routes usecontainedModaland continue blocking swipe-down dismissal.modalpresentation and allow swipe-down dismissal. The dismissal can be blocked with a visibletrigger="back"behavior.This is opt-in because native
modalchanges the iOS visual layering as well as enabling the dismissal gesture. Keeping the default disabled preserves the existing Hyperview experience while allowing hosts to choose native modal behavior.Dependencies and compatibility
@react-navigation/stackwith@react-navigation/native-stack.describepath while testing against the current React Navigation 6 dependency set.Testing
Transition comparison
Moderate transition differences are expected because transitions are now rendered by the native stack.
enableModalDismissGesture
Asana task