move NativeModule initialization off UI thread

Summary: Initializing natives modules on the UI thread blocks the JS thread if the UI thread is busy.

Reviewed By: yungsters

Differential Revision: D4611211

fbshipit-source-id: cd4fb9cb5e52a478b6692b784cfd9e3bf34c0d34
This commit is contained in:
Aaron Chiu
2017-03-06 21:01:48 -08:00
committed by Facebook Github Bot
parent e32e4d9711
commit b085215237
10 changed files with 116 additions and 82 deletions

View File

@@ -139,6 +139,9 @@ public class NativeModuleRegistryBuilder {
}
}
return new NativeModuleRegistry(mModules, batchCompleteListenerModules);
return new NativeModuleRegistry(
mReactApplicationContext,
mModules,
batchCompleteListenerModules);
}
}