Files
react-native/packages/react-native/ReactAndroid
Nicola Corti ccc50ddd2d Fabric Interop - Properly dispatch integer commands (#38527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38527

This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching.
(See https://github.com/terrylinla/react-native-sketch-canvas/issues/236)

The problem is that libraries that were receiving commands as ints with:
```
public void receiveCommand(
      int surfaceId, int reactTag, int commandId, Nullable ReadableArray commandArgs) {
```

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 as `int` (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
2023-07-21 10:17:31 -07:00
..
2023-07-11 04:04:10 -07:00

Building React Native for Android

See the Building from Source guide on the React Native website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing guide on the React Native website.