[Docs] Document Touchable hover callbacks - #4399
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Touchable documentation updates press and long-press callbacks to use ChangesTouchable callback documentation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/docs-gesture-handler/docs/components/touchable.mdxParsing error: ESLint was configured to run on Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
738b03e to
62ca5fa
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Gesture Handler 3 docs for the new Touchable component by documenting onHoverIn / onHoverOut, including detailed platform-specific behavior (pairing semantics, disabled interactions, press-drag behavior, tvOS focus-driven hover, and unmount/detach behavior).
Changes:
- Add new
onHoverInandonHoverOutprop sections to theTouchabledocumentation. - Describe non-obvious behavioral details and platform differences for hover callbacks.
- Provide event/type signatures for the new hover callbacks via
CollapsibleCode.
Suppressed comments (2)
packages/docs-gesture-handler/docs/components/touchable.mdx:505
- Same as above: the public
ButtonEventtype usespointerType: number(notPointerType), so this snippet should match that to avoid contradicting the exported TS types.
absoluteX: number;
absoluteY: number;
numberOfPointers: number;
pointerType: PointerType;
}
packages/docs-gesture-handler/docs/components/touchable.mdx:486
- This page now documents hover callbacks using
ButtonEvent, but the existingonPressIn/onPressOut/onPresssections above still showGestureEvent<NativeHandlerData>. In the current v3 API,TouchablePropstypes all of these as(event: ButtonEvent) => void, so the page mixes two incompatible signatures.
Triggered when a non-touch pointer — a mouse, a trackpad cursor, or a hovering stylus — moves over the button (analogous to `onHoverIn` in `Pressable` from RN core). Touch pointers never report hover.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62ca5fa to
886f0db
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/docs-gesture-handler/docs/components/touchable.mdx`:
- Around line 378-386: Wrap every ButtonEvent object type in Readonly<> to
preserve the exported event contract. Apply this to the onPressIn declaration in
packages/docs-gesture-handler/docs/components/touchable.mdx lines 378-386, and
likewise update the onPressOut declaration at lines 408-416, onPress at lines
438-446, onLongPress at lines 468-476, onHoverIn at lines 498-506, and
onHoverOut at lines 528-536.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f51a769a-f0f6-4c1f-8eca-9dc32fad3e5d
📒 Files selected for processing (1)
packages/docs-gesture-handler/docs/components/touchable.mdx
886f0db to
a3acc5a
Compare
a3acc5a to
47760bf
Compare
m-bert
left a comment
There was a problem hiding this comment.
Tbh I don't like the fact that this long hover explanation is below onHoverOut. I mean I know that it is in the right section, but some parts sound like they belong to onHoverIn rather than onHoverOut. Maybe we could duplicate it? Also this is now one big section amid prop descriptions, while it covers both props at the same time.
47760bf to
9089315
Compare
## Description Documents `onHoverIn`/`onHoverOut` on the `Touchable` page, together with the behaviour that isn't obvious from the signature: how the two pair up, what `disabled` does to an open hover, which platforms report the crossings during a press, tvOS driving hover from focus, and hover state not surviving an unmount or a detach. Also refreshes the press callbacks on the same page, which still described the pre-#4342/#4343 signature. `onPress`, `onPressIn` and `onPressOut` take a `ButtonEvent` rather than a `GestureEvent<NativeHandlerData>`, and `onLongPress` takes an event at all — the old snippets additionally listed a `handlerTag` field that `ButtonEvent` does not carry, and omitted `x`/`y`/`absoluteX`/`absoluteY`. Leaving them alone would have put contradictory signatures directly above the new hover blocks. ## Test plan `yarn start` in `packages/docs-gesture-handler`.
9089315 to
3c664a6
Compare
Description
Documents
onHoverIn/onHoverOuton theTouchablepage, togetherwith the behaviour that isn't obvious from the signature: how the two
pair up, what
disableddoes to an open hover, which platforms reportthe crossings during a press, tvOS driving hover from focus, and hover
state not surviving an unmount or a detach.
Test plan
yarn startinpackages/docs-gesture-handler.