Overview
In nested navigation hierarchies, multiple navigators may want to handle gestures on the same axis (horizontal or vertical). Gesture ownership ensures only one navigator controls a given direction, preventing conflicts and confusion.Core Principle: Per-Direction Ownership
Each gesture axis has exactly one owner:- Parent owns vertical drag (can dismiss child)
- Child owns horizontal drag (can navigate between siblings)
- Both work simultaneously without conflict
Child Shadows Parent
When a child navigator and parent both want to handle the same axis, the child wins:Gesture Inheritance
When a child doesn’t explicitly claim a gesture, it inherits the parent’s:Snap Points Claim Ownership
Defining snap points automatically claims ownership of that axis:gestureDirection: "vertical".
Practical Examples
Two-Axis Navigation
Parent handles one axis, child handles another—no conflicts:- Parent claims horizontal (slide between tabs)
- Child claims vertical (tap to expand sheet, swipe to dismiss)
- Both work simultaneously ✓
Same-Axis Shadowing
Child sheet shadows parent’s vertical gesture:- Parent initially claims vertical
- When Details sheet opens, child claims vertical
- Parent cannot vertically dismiss Details
- Swipe down on Details closes it (child’s gesture)
- To return to Home, use Back button or tap header
ScrollView at Boundary
ScrollView gestures coordinate with navigator gestures using the boundary concept:- Scrolling when ScrollView is NOT at top: ScrollView owns the gesture
- Scrolling when ScrollView IS at top (scrollY = 0): Gesture transfers to sheet
- With
"expand-and-collapse": Drag up expands the sheet - With
"collapse-only": Drag has no effect; use dead space to expand
- With
Stack Dismissal Ownership
The topmost screen in each navigator claims dismissal:Nested Scenarios
Scenario: Detail Stack Inside Tab Navigation
- Tabs claim horizontal (swipe left/right to switch)
- Detail Stack claims vertical (swipe up to go back)
- Both work simultaneously
Scenario: Paged Sheets with Modal
- Modal claims vertical (snap points)
- Paged Stack claims horizontal (swipe between pages)
- Modal gesture is shadowed from parent (parent can’t dismiss)
- Both modal and page navigation work
Advanced: Ancestor Targeting
Use hooks to explicitly set gesture ownership:"self": Gesture on this screen"parent": Gesture owned by parent navigator"root": Gesture owned by root navigator{ ancestor: 2 }: Gesture owned by ancestor at level 2
Troubleshooting Ownership
”Parent gesture doesn’t work; child shadows it”
This is intentional. A child navigator’s gesture claims the axis. To re-enable parent gesture:“Child gesture not responding”
Parent may be claiming the axis. Check:- Parent’s
gestureDirection: Ensure it’s different from child - Parent’s
gestureEnabled: Disable if not needed - Snap points: Verify child has snap points if using Modal with vertical snap
”ScrollView scroll and navigator gesture conflict”
UsesheetScrollGestureBehavior to define the boundary:
Best Practices
- Use different axes when possible: Parent horizontal, child vertical
- Snap points implicitly claim ownership: No need to duplicate gesture props
- Test with nested navigators: Verify both levels respond as expected
- ScrollView at boundaries: Use
sheetScrollGestureBehaviorto avoid confusion - Document gesture ownership in complex hierarchies to avoid surprises
Visual Reference
→horizontal gesture↕vertical snap/gesture- Child gestures shadow parent on same axis
Next Steps
- See Gestures for gesture configuration options
- Learn Snap Points for sheet-specific behavior
- Explore ScrollViews for scroll coordination details
