From 2b89416ac0bf1a420af56543310b41d39ce4fe6c Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Thu, 22 Jun 2017 11:34:16 -0700 Subject: [PATCH] Only load core modules once Reviewed By: javache, AaaChiuuu Differential Revision: D5303176 fbshipit-source-id: f00ecacaa695ce7a4f8b57c66cee38bb70883cae --- .../com/facebook/react/ReactInstanceManager.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index ee72e9a4b..d12a8ae4b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -255,6 +255,14 @@ public class ReactInstanceManager { mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; mMinNumShakes = minNumShakes; + CoreModulesPackage coreModulesPackage = + new CoreModulesPackage( + this, + mBackBtnHandler, + mUIImplementationProvider, + mLazyViewManagersEnabled); + mPackages.add(0, coreModulesPackage); + // Instantiate ReactChoreographer in UI thread. ReactChoreographer.initialize(); } @@ -954,13 +962,6 @@ public class ReactInstanceManager { reactContext.setNativeModuleCallExceptionHandler(mDevSupportManager); } - CoreModulesPackage coreModulesPackage = - new CoreModulesPackage( - this, - mBackBtnHandler, - mUIImplementationProvider, - mLazyViewManagersEnabled); - mPackages.add(0,coreModulesPackage); NativeModuleRegistry nativeModuleRegistry = processPackages(reactContext, mPackages, false); NativeModuleCallExceptionHandler exceptionHandler = mNativeModuleCallExceptionHandler != null