Skip to content

Commit 46df827

Browse files
JoshuaGrossfacebook-github-bot
authored andcommitted
Support RCTModernEventEmitter+RCTEventEmitter in ReactAccessibilityDelegate.Anonymous Event class
Summary: Support RCTModernEventEmitter +RCTEventEmitter in an Event class. This improves perf in Fabric. Migrate any constructor callsites to the new constructor and deprecate the previous one. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D26043393 fbshipit-source-id: b126658d818a18b7ffb2794de8e59a49c0e3d258
1 parent 72d0ddc commit 46df827

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import com.facebook.react.bridge.WritableMap;
3636
import com.facebook.react.uimanager.events.Event;
3737
import com.facebook.react.uimanager.events.EventDispatcher;
38-
import com.facebook.react.uimanager.events.RCTEventEmitter;
3938
import java.util.HashMap;
4039

4140
/**
@@ -295,20 +294,21 @@ public boolean performAccessibilityAction(View host, int action, Bundle args) {
295294
ReactContext reactContext = (ReactContext) host.getContext();
296295
if (reactContext.hasActiveCatalystInstance()) {
297296
final int reactTag = host.getId();
297+
final int surfaceId = UIManagerHelper.getSurfaceId(reactContext);
298298
UIManager uiManager = UIManagerHelper.getUIManager(reactContext, reactTag);
299299
if (uiManager != null) {
300300
uiManager
301301
.<EventDispatcher>getEventDispatcher()
302302
.dispatchEvent(
303-
new Event(reactTag) {
303+
new Event(surfaceId, reactTag) {
304304
@Override
305305
public String getEventName() {
306306
return TOP_ACCESSIBILITY_ACTION_EVENT;
307307
}
308308

309309
@Override
310-
public void dispatch(RCTEventEmitter rctEventEmitter) {
311-
rctEventEmitter.receiveEvent(reactTag, TOP_ACCESSIBILITY_ACTION_EVENT, event);
310+
protected WritableMap getEventData() {
311+
return event;
312312
}
313313
});
314314
}

0 commit comments

Comments
 (0)