Ensure Bridge and Bridgeless register native modules using the same order

Summary: I've noticed that Bridge and Bridgeless initialize the list of ReactPackages using a different order, we are fixing it in this diff

Reviewed By: philIip

Differential Revision: D52145148

fbshipit-source-id: 6ad85bd0903f9beab455783e8deaf5c529b87a2e
This commit is contained in:
David Vacca
2023-12-16 13:57:04 -08:00
committed by Facebook GitHub Bot
parent 479b4bb1ba
commit 17d2c8acb9
@@ -208,11 +208,12 @@ final class ReactInstance {
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.initialize#initTurboModules");
mReactPackages = new ArrayList<>(mDelegate.getReactPackages());
mReactPackages = new ArrayList<>();
mReactPackages.add(
new CoreReactPackage(
bridgelessReactContext.getDevSupportManager(),
bridgelessReactContext.getDefaultHardwareBackBtnHandler()));
mReactPackages.addAll(mDelegate.getReactPackages());
TurboModuleManagerDelegate turboModuleManagerDelegate =
mDelegate