Open
Conversation
added 11 commits
April 14, 2026 13:13
…ied pinch gesture boundary check
nd versioned docs to also not rely on the SrcFiles
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the docs site examples and dependencies for docs-gesture-handler, aligning interactive gesture examples with the newer docs structure and updated runtime packages.
Changes:
- Update docs pages to load examples from new locations (and remove embedded preview videos).
- Add/refresh versioned
2.xexample implementations underversioned_docs. - Bump the docs site’s React Native ecosystem deps (RNGH, Reanimated, RN Web, Worklets) and adjust the Babel plugin accordingly.
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/docs-gesture-handler/yarn.lock | Dependency lock updates after package bumps. |
| packages/docs-gesture-handler/package.json | Bumps docs-site deps (RNGH, Reanimated, RN Web, Worklets). |
| packages/docs-gesture-handler/babel.config.js | Switches Babel plugin to react-native-worklets/plugin. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/tap-gesture.md | Points 2.x doc page to versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/rotation-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/pinch-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/pan-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/long-press-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/hover-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/gestures/fling-gesture.md | Same: versioned example imports; removes video blocks. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/TapGestureBasic.js | Adds a versioned 2.x tap example. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/RotationGestureBasic.js | Adds a versioned 2.x rotation example. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PinchGestureBasic.js | Adds a versioned 2.x pinch example. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PanGestureBasic.js | Updates versioned 2.x pan example sizing/measurement. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/LongPressGestureBasic.js | Adds a versioned 2.x long-press example. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/HoverGestureBasic.js | Adds a versioned 2.x hover example. |
| packages/docs-gesture-handler/versioned_docs/version-2.x/examples/FlingGestureBasic.js | Updates versioned 2.x fling example sizing/measurement. |
| packages/docs-gesture-handler/static/examples/TapGestureBasic.js | Migrates static tap example to useTapGesture. |
| packages/docs-gesture-handler/static/examples/RotationGestureBasic.js | Migrates static rotation example to usePanGesture. |
| packages/docs-gesture-handler/static/examples/RotationGestureBasicSrc.js | Removes old *Src file (raw-loader now targets main example). |
| packages/docs-gesture-handler/static/examples/PinchGestureBasic.js | Migrates static pinch example to usePanGesture and new measurement logic. |
| packages/docs-gesture-handler/static/examples/PinchGestureBasicSrc.js | Removes old *Src file (raw-loader now targets main example). |
| packages/docs-gesture-handler/static/examples/PanGestureBasic.js | Migrates static pan example to usePanGesture and new measurement logic. |
| packages/docs-gesture-handler/static/examples/LongPressGestureBasic.js | Migrates static long-press example to useLongPressGesture. |
| packages/docs-gesture-handler/static/examples/HoverGestureBasic.js | Migrates static hover example to useHoverGesture. |
| packages/docs-gesture-handler/static/examples/FlingGestureBasic.js | Migrates static fling example to useFlingGesture. |
| packages/docs-gesture-handler/docs/legacy-gestures/rotation-gesture.md | Updates raw-loader import to point at main example file. |
| packages/docs-gesture-handler/docs/legacy-gestures/pinch-gesture.md | Updates raw-loader import to point at main example file. |
| packages/docs-gesture-handler/docs/legacy-gestures/pan-gesture.md | Updates raw-loader import to point at main example file. |
| packages/docs-gesture-handler/docs/legacy-gestures/fling-gesture.md | Updates raw-loader import to point at main example file. |
| packages/docs-gesture-handler/docs/gestures/use-tap-gesture.mdx | Removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-rotation-gesture.mdx | Updates raw-loader import + removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-pinch-gesture.mdx | Updates raw-loader import + removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-pan-gesture.mdx | Updates raw-loader import + removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-long-press-gesture.mdx | Removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-hover-gesture.mdx | Removes embedded preview video blocks. |
| packages/docs-gesture-handler/docs/gestures/use-fling-gesture.mdx | Updates raw-loader import + removes embedded preview video blocks. |
Comments suppressed due to low confidence (6)
packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PanGestureBasic.js:84
GestureHandlerRootViewdoesn’t forward refs, soref={containerRef}will be ignored andmeasureInWindowwon’t updatemaxTranslateX/Y. This will keep the clamp bounds at 0 and prevent dragging. Put the ref on an innerViewwrapper instead.
packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PanGestureBasic.js:71clampis called inside.onUpdate, which runs as a worklet when using the Reanimated-integratedGestureAPI. A plain JS helper can cause runtime failures when called from a worklet. Add a'worklet'directive toclampor inline the clamp logic in the callback.
packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PanGestureBasic.js:76- Same worklet concern for Y translation:
clampis invoked in the worklet.onUpdatecallback. Ensureclampis worklet-safe to avoid runtime errors.
packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PanGestureBasic.js:42 maxTranslateYis set toheight / 2, which lets the 100px-tall box translate beyond the container’s vertical bounds. To keep it fully visible, subtract half the box size (similar to the X calculation).
packages/docs-gesture-handler/static/examples/PanGestureBasic.js:71onUpdatecallbacks created byusePanGesturerun as worklets; calling a plain JS helper likeclampfrom inside them can throw at runtime (“tried to call a non-worklet function”). Markclampas a worklet (add a'worklet'directive) or inline the min/max logic inside the callbacks.
onUpdate: (event) => {
translationX.value = clamp(
prevTranslationX.value + event.translationX,
-maxTranslateX.value,
maxTranslateX.value
);
packages/docs-gesture-handler/versioned_docs/version-2.x/examples/FlingGestureBasic.js:63
clampis called inside the worklet.onStartcallback (Reanimated-integratedGestureAPI). Ifclampisn’t workletized, this can throw at runtime. Add a'worklet'directive toclampor inline the clamp logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…re-handler into @relextm19/docs-examples
…re-handler into @relextm19/docs-examples Merged main
m-bert
requested changes
Apr 16, 2026
Collaborator
m-bert
left a comment
There was a problem hiding this comment.
Good job 🎉
Please also update section Gesture Handler 2.
| const colorIndex = useSharedValue(1); | ||
|
|
||
| const tap = Gesture.Tap().onEnd(() => { | ||
| if (colorIndex.value > COLORS.length) { |
Collaborator
There was a problem hiding this comment.
Same as in not versioned file
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
…n/react-native-gesture-handler into @relextm19/docs-examples
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
Updated docs examples for v2 and v3 api. Removed videos from docs.
Test plan
Manually tested changes