Skip to content

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Feb 10, 2026

Description

This PR exports new createNativeWrapper implementation and renames old one to legacy_createNativeWrapper. It also updated documentation, along with skill for LLM migration.

Test plan

Check example from new docs.

Copy link
Contributor

Copilot AI left a 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 createNativeWrapper and rename the legacy export to legacy_createNativeWrapper.
  • Add/extend upgrade + migration-skill documentation for the new wrapper, including the new detectorType parameter.
  • 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.

Comment on lines 25 to 27
config: NativeWrapperProperties,
detectorType: GestureDetectorType,
): React.FC<P>
Copy link

Copilot AI Feb 10, 2026

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.

Suggested change
config: NativeWrapperProperties,
detectorType: GestureDetectorType,
): React.FC<P>
config?: NativeWrapperProperties,
detectorType?: GestureDetectorType,
): React.FC<P & NativeWrapperProperties>

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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)

Comment on lines +48 to +59
### 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)).

Copy link

Copilot AI Feb 10, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant