mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RN Android: Support View Manager Commands that are strings
Summary:
Right now JS triggers a view manager command with the following code:
```
UIManager.dispatchViewManagerCommand(
ReactNative.findNodeHandle(this),
UIManager.getViewManagerConfig('RCTView').Commands.hotspotUpdate,
[destX || 0, destY || 0],
);
```
As we want to get rid of calls to UIManager, we need to stop looking for the integer defined in native from JavaScript. We will be changing methods like this to be:
```
UIManager.dispatchViewManagerCommand(
ReactNative.findNodeHandle(this),
'hotspotUpdate',
[destX || 0, destY || 0],
);
```
We need to support ints and Strings to be backwards compatible, but ints will be deprecated.
Reviewed By: shergin
Differential Revision: D15955444
fbshipit-source-id: d1c488975ae03404f8f851a7035b58a90ed34163
This commit is contained in:
committed by
Facebook Github Bot
parent
4b8d07ebf3
commit
3cae6fa950
@@ -748,6 +748,11 @@ public class UIImplementation {
|
||||
mOperationsQueue.enqueueDispatchCommand(reactTag, commandId, commandArgs);
|
||||
}
|
||||
|
||||
public void dispatchViewManagerCommand(int reactTag, String commandId, @Nullable ReadableArray commandArgs) {
|
||||
assertViewExists(reactTag, "dispatchViewManagerCommand");
|
||||
mOperationsQueue.enqueueDispatchCommand(reactTag, commandId, commandArgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a PopupMenu.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user