fix(android): use composition for JSPointerDispatcherCompat#1477
Merged
kirillzyusko merged 1 commit intoJun 1, 2026
Merged
Conversation
JSPointerDispatcher became a final Kotlin class in React Native 0.87+ (after the Java-to-Kotlin migration in #56910), so JSPointerDispatcherCompat can no longer extend it. Switch from inheritance to composition by holding an internal JSPointerDispatcher delegate and forwarding calls to it.
Contributor
📊 Package size report
|
cortinico
commented
Jun 1, 2026
|
|
||
| /** | ||
| * Compat layer for `JSPointerDispatcher` interface for RN < 0.72 | ||
| * Compat layer for `JSPointerDispatcher` interface for RN < 0.72. |
Contributor
Author
There was a problem hiding this comment.
@kirillzyusko also this is quote of an old version of RN. Perhaps the compat layer can go altogether?
Owner
There was a problem hiding this comment.
Yes @cortinico
I will do it this year. I'm going to drop old architecture support and bump minimal RN version to RN 0.77 or something like this 🤞
I know that RN has window support for only 3 versions, but I believe I don't have so much conditional code to support more RN versions, so I'm fine to leave with few additional if-statements 🙂
kirillzyusko
approved these changes
Jun 1, 2026
Owner
|
Thank you @cortinico for your PR! I'll prepare next patch release right now 👍 |
Owner
|
@cortinico new |
Contributor
Author
|
Thank you very much @kirillzyusko 🙏 |
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
JSPointerDispatcher became a final Kotlin class in React Native 0.87+
(after the Java-to-Kotlin migration in react/react-native#56910), so
JSPointerDispatcherCompat can no longer extend it.
While I'm restoring it in:
Ideally we would want to reduce the API surface of RN apis.
So here I'm switching from inheritance to composition by holding an internal
JSPointerDispatcher delegate and forwarding calls to it.
🤔 How Has This Been Tested?
Looking for guidance on how to test this.
📸 Screenshots (if appropriate):
N/A
📝 Checklist