From e8323781fac8b19bb8a4faa53461c33ff201817b Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Mon, 20 Nov 2023 10:26:27 -0800 Subject: [PATCH] Fix ReactInstanceManager to add getJSIModule() as an alternate path (#41495) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41495 Fix ReactInstanceManager for adding the callsite of `getJSIModule()` as an alternate path to new way of Fabric initialization in order to make Catalyst and RN-Tester work with the changes for Fabric initialization Reviewed By: javache Differential Revision: D51338036 fbshipit-source-id: 49badac52f1032f1032a989b76dd422e3cf7582f --- .../src/main/java/com/facebook/react/ReactInstanceManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 2ae69e229714bb..6a4c0df440d9a1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1407,9 +1407,10 @@ private ReactApplicationContext createReactContext( reactContext, catalystInstance.getJavaScriptContextHolder())); } if (ReactFeatureFlags.enableFabricRenderer) { - catalystInstance.getJSIModule(JSIModuleType.UIManager); if (mUIManagerProvider != null) { catalystInstance.setFabricUIManager(mUIManagerProvider.createUIManager(reactContext)); + } else { + catalystInstance.getJSIModule(JSIModuleType.UIManager); } } if (mBridgeIdleDebugListener != null) {