[General] Add yieldsToNativeGestures property to native gesture#4135
Merged
j-piasecki merged 12 commits intomainfrom May 4, 2026
Merged
[General] Add yieldsToNativeGestures property to native gesture#4135j-piasecki merged 12 commits intomainfrom
yieldsToNativeGestures property to native gesture#4135j-piasecki merged 12 commits intomainfrom
Conversation
… symbol directly
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new yieldsToNativeGestures configuration option to the “native” gesture so disallowInterruption can still block RNGH gestures (Pan/Tap/etc.) while allowing native containers (e.g., ScrollView) to take over—fixing Touchable usability inside scrollables.
Changes:
- Introduces
yieldsToNativeGesturesconfig across web + v3 native gesture typings and documentation. - Implements platform behavior changes (web/iOS/Android) to allow yielding to native gestures when
disallowInterruptionis enabled. - Updates v3
Touchableto opt intoyieldsToNativeGestures: true.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-gesture-handler/src/web/interfaces.ts | Adds yieldsToNativeGestures to web handler config typing. |
| packages/react-native-gesture-handler/src/web/handlers/NativeViewGestureHandler.ts | Updates web native-handler interaction logic to optionally yield to other native handlers. |
| packages/react-native-gesture-handler/src/v3/hooks/gestures/native/NativeTypes.ts | Exposes the new property in v3 Native gesture types and native-prop allowlist. |
| packages/react-native-gesture-handler/src/v3/components/Touchable/Touchable.tsx | Enables yielding for v3 Touchable by default. |
| packages/react-native-gesture-handler/apple/RNGestureHandler.mm | Moves the UIGestureRecognizer category interface out (implementation remains here). |
| packages/react-native-gesture-handler/apple/RNGestureHandler.h | Declares gestureHandler category in a header so other files can use it. |
| packages/react-native-gesture-handler/apple/Handlers/RNNativeViewHandler.mm | Implements yielding behavior by not cancelling native/non-RNGH and dummy recognizers when configured. |
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt | Adjusts cancellation policy to respect yielding for native/root-native handlers. |
| packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt | Adds new flag + updates simultaneous/cancellation behavior (needs a fix noted in review comment). |
| packages/docs-gesture-handler/docs/gestures/use-native-gesture.mdx | Documents yieldsToNativeGestures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
m-bert
reviewed
May 4, 2026
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.
Description
Currently,
NativeViewGestureHandlerexposesdisallowInterruptionproperty, which causes it to cancel all other gestures upon activation. This is great for theTouchablecomponent, since it shouldn't allow other gesture handlers to activate when it's pressed. The issue with that was the fact thatdisallowInterruptionmeans that all native gestures are cancelled as well, includingScrollViewor any other custom container, makingTouchablenot usable in real use-cases.This PR adds
yieldsToNativeGesturesproperty, which works only whendisallowInterruptionistrue. It defaults tofalse, where it behaves asdisallowInterruptiondoes currently. When set totrue, it allows the gesture to be canceled by other native gestures but not any other type of gesture.Touchable is now using this new config to make it work inside scrollable containers.
Test plan
Changed
RectButtonswithTouchablesin the common appScreen.Recording.2026-04-30.at.08.07.55.mov
Screen.Recording.2026-04-30.at.08.06.28.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-30.at.08.08.29.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-30.at.08.07.20.mov
Since scrolling on web dispatches
pointercancelevent, this prop is effectively a no-op forTouchable.