Skip to content

[Android] Resolve the button event dispatcher by react tag - #4415

Merged
m-bert merged 2 commits into
mainfrom
@mbert/android-build-84
Aug 13, 2026
Merged

[Android] Resolve the button event dispatcher by react tag#4415
m-bert merged 2 commits into
mainfrom
@mbert/android-build-84

Conversation

@m-bert

@m-bert m-bert commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Description

Changes getEventDispatcher(reactContext) to getEventDispatcherForReactTag(reactContext, this.id) in order to fix builds on RN < 0.85

Test plan

Build 0.87, 0.84 and 0.83

Copilot AI lite review requested due to automatic review settings August 13, 2026 13:40
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d77fe64-a2c2-4ee9-bcb6-e01fc9e24a35

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4b93f and 8263ded.

📒 Files selected for processing (1)
  • packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved button press and hover event handling to ensure events are dispatched through the correct React view context.

Walkthrough

Button press and hover events now resolve their event dispatcher from the button’s React view tag. Compatibility notes document support for older React Native versions.

Changes

Button event dispatch

Layer / File(s) Summary
Tag-based event dispatcher lookup
packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt
dispatchJSEvent and dispatchHoverEvent now obtain event dispatchers by the button’s React view tag.

Mergeability Score: ⚪ Minimal · up to 8263d

This localized Android change updates event-dispatcher resolution for React Native compatibility, and no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change to resolve the Android button event dispatcher by React tag.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Android RNGestureHandlerButtonViewManager event emission path to resolve the EventDispatcher using a React tag (view.id) via UIManagerHelper.getEventDispatcherForReactTag(...), aligning the button event dispatch mechanism with the API needed to support building against older React Native versions (< 0.85).

Changes:

  • Switched button press event dispatch to use UIManagerHelper.getEventDispatcherForReactTag(reactContext, this.id).
  • Switched hover event dispatch to use UIManagerHelper.getEventDispatcherForReactTag(reactContext, this.id).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@m-bert
m-bert merged commit 44046a6 into main Aug 13, 2026
4 checks passed
@m-bert
m-bert deleted the @mbert/android-build-84 branch August 13, 2026 13:59
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.

3 participants