[LOCAL] Fabric Interop - Properly dispatch integer commands (#38527) #38835
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.
Summary:
Pull Request resolved: #38527
This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching. (See terrylinla/react-native-sketch-canvas#236)
The problem is that libraries that were receiving commands as ints with:
would not receive command with the Fabric Interop for Android.
The problem is that with Fabric, events are dispatched as string always. cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.
The logic is, if the event is dispatched as a string that represents a number (say
"42"
) and the user has Fabric Interop enabled, then we dispatch the event asint
(so libraries will keep on working).Changelog:
[Android] [Fixed] - Fabric Interop - Properly dispatch integer commands
Reviewed By: cipolleschi
Differential Revision: D47600094
fbshipit-source-id: c35f0509e6c6c0cddc7090a069882f92dd95532e
Summary:
This is a pick of ccc50dd against the 0.72-stable branch where I've resolved all the merge conflicts. See #38527
Old Summary:
This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching. (See terrylinla/react-native-sketch-canvas#236)
The problem is that libraries that were receiving commands as ints with:
would not receive command with the Fabric Interop for Android.
The problem is that with Fabric, events are dispatched as string always. cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.
The logic is, if the event is dispatched as a string that represents a number (say
"42"
) and the user has Fabric Interop enabled, then we dispatch the event asint
(so libraries will keep on working).Changelog:
[Android] [Fixed] - Fabric Interop - Properly dispatch integer commands
Test Plan:
Already merged on main