From bce1b27190a2e0fa30675d1b333d4e1046f6d422 Mon Sep 17 00:00:00 2001 From: Alex Hendrix Date: Wed, 10 Apr 2024 09:01:34 -0500 Subject: [PATCH] [Discord] Moving registry of RCTEventEmitter to constructor --- .../java/com/facebook/react/uimanager/UIManagerModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index dca4fcf5b13098..ad1c8b66450266 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -148,6 +148,8 @@ public UIManagerModule( minTimeLeftInFrameForNonBatchedOperationMs); reactContext.addLifecycleEventListener(this); + mEventDispatcher.registerEventEmitter( + DEFAULT, getReactApplicationContext().getJSModule(RCTEventEmitter.class)); } /** @@ -175,8 +177,6 @@ public Map getConstants() { public void initialize() { getReactApplicationContext().registerComponentCallbacks(mMemoryTrimCallback); getReactApplicationContext().registerComponentCallbacks(mViewManagerRegistry); - mEventDispatcher.registerEventEmitter( - DEFAULT, getReactApplicationContext().getJSModule(RCTEventEmitter.class)); } @Override