-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Export new createNativeWrapper
#3971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Exports the RNGH3 (v3) createNativeWrapper as the public createNativeWrapper API while preserving the previous implementation under legacy_createNativeWrapper, and updates migration guidance/docs accordingly.
Changes:
- Re-export v3
createNativeWrapperand rename the legacy export tolegacy_createNativeWrapper. - Add/extend upgrade + migration-skill documentation for the new wrapper, including the new
detectorTypeparameter. - Add a dedicated docs page for
createNativeWrapper.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/gesture-handler-3-migration/SKILL.md | Updates LLM migration instructions to mention the rewritten createNativeWrapper and legacy fallback. |
| packages/react-native-gesture-handler/src/v3/index.ts | Exports the new v3 createNativeWrapper. |
| packages/react-native-gesture-handler/src/index.ts | Renames the legacy export to legacy_createNativeWrapper while continuing to export v3 APIs. |
| packages/docs-gesture-handler/docs/guides/upgrading-to-3.mdx | Adds an upgrade-guide section describing the new createNativeWrapper. |
| packages/docs-gesture-handler/docs/components/create-native-wrapper.mdx | Adds a new API docs page for createNativeWrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| config: NativeWrapperProperties, | ||
| detectorType: GestureDetectorType, | ||
| ): React.FC<P> |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createNativeWrapper API signature in the docs marks config and detectorType as required and the return type as React.FC<P>, but the implementation provides defaults for both parameters and the returned component also accepts wrapper props (e.g., NativeWrapperProperties). Please update the signature/return type to reflect the actual exported types so users don't lose type-safety or miss available props.
| config: NativeWrapperProperties, | |
| detectorType: GestureDetectorType, | |
| ): React.FC<P> | |
| config?: NativeWrapperProperties, | |
| detectorType?: GestureDetectorType, | |
| ): React.FC<P & NativeWrapperProperties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated return type in 4f54383.
I don't think we should add ? to they arguments' types as this is true only from user's perspective (cc @j-piasecki)
| ### detectorType | ||
|
|
||
| ```ts | ||
| enum GestureDetectorType { | ||
| Native, | ||
| Virtual, | ||
| Intercepting, | ||
| } | ||
| ``` | ||
|
|
||
| Type of the gesture detector that will be used to recognize the `Native` gesture. For more details on available options, see the [Gesture Detectors](/docs/fundamentals/gesture-detectors) documentation. Defaults to `GestureDetectorType.Native` (which is just [`GestureDetector`](/docs/fundamentals/gesture-detectors#gesture-detector)). | ||
|
|
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs suggest you can switch to GestureDetectorType.Virtual by just passing detectorType, but the underlying VirtualGestureDetector requires being rendered under an InterceptingGestureDetector (it throws otherwise). Consider adding an explicit note/example showing the required InterceptingGestureDetector wrapper when using GestureDetectorType.Virtual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is described in the gesture detectors section, so I'm not sure if it is required here. If someone doesn't know how it works, they will probably have to look into these docs anyway (cc @akwasniewski)
Description
This PR exports new
createNativeWrapperimplementation and renames old one tolegacy_createNativeWrapper. It also updated documentation, along with skill for LLM migration.Test plan
Check example from new docs.