diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java index 61665a11dd944c..94515d47be1273 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java @@ -72,10 +72,11 @@ protected void init(int surfaceId, int viewTag, long timestampMs) { // We infer UIManagerType. Even though it's not passed in explicitly, we have a // contract that Fabric events *always* have a SurfaceId passed in, and non-Fabric events // NEVER have a SurfaceId passed in (the default/placeholder of -1 is passed in instead). + // // Why does this matter? // Events can be sent to Views that are part of the View hierarchy *but not directly managed // by React Native*. For example, embedded custom hierachies, Litho hierachies, etc. - // In those cases it's important to konw that the Event should be sent to the Fabric or + // In those cases it's important to know that the Event should be sent to the Fabric or // non-Fabric UIManager, and we cannot use the ViewTag for inference since it's not controlled // by RN and is essentially a random number. // At some point it would be great to pass the SurfaceContext here instead. diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java index a1eb560914b6e4..b1098cb0f63e04 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/ReactEventEmitter.java @@ -86,7 +86,7 @@ public void receiveTouches( @Override public void receiveTouches(TouchEvent event) { int reactTag = event.getViewTag(); - @UIManagerType int uiManagerType = ViewUtil.getUIManagerType(reactTag); + @UIManagerType int uiManagerType = event.getUIManagerType(); if (uiManagerType == UIManagerType.FABRIC && mFabricEventEmitter != null) { mFabricEventEmitter.receiveTouches(event); } else if (uiManagerType == UIManagerType.DEFAULT && getEventEmitter(reactTag) != null) {