mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
608cf6fe09
Summary:
## Description
CompositeReactPackage will now eagerly initialize all NativeModules inside the TurboReactPackages. Before it would just crash the program because calling `createNativeModules()` on the TurboReactPackage instance. Longer term, we should make CompositeReactPackage a TurboReactPackage.
## Why am I making this change?
I made MainReactPackage into a TurboReactPackge. But ExpressWifiTechnician uses MainReactPackage to create a CompositeReactPackage:
**java/com/expresswifi/technician/MainActivity.java**
```
protected ReactPackage getPackage() {
ReactInstanceManager reactInstanceManager = getReactInstanceManager();
Nullable DevSupportManager devSupportManager = null;
if (reactInstanceManager != null) {
devSupportManager = reactInstanceManager.getDevSupportManager();
}
return new CompositeReactPackage(
super.getPackage(),
mXWFTechnicianReactPackage,
new RNFusedLocationPackage(),
mXWFTechnicialMobileConfigPackageProvider.get(devSupportManager));
}
```
**java/com/facebook/catalyst/shell/MainReactActivity.java**
```
public abstract class MainReactActivity extends AbstractReactActivity {
protected ReactPackage getPackage() {
return new MainReactPackage();
}
}
```
Reviewed By: fkgozali
Differential Revision: D15738677
fbshipit-source-id: 3220dfe6434de56f2917c77fb21acef4cfc79278
Building React Native for Android
See the docs on the website.
Running tests
When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.