Skip to content

Commit

Permalink
Ensure Bridge and Bridgeless register native modules using the same o…
Browse files Browse the repository at this point in the history
…rder

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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Dec 16, 2023
1 parent 479b4bb commit 17d2c8a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ public void onHostDestroy() {
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
Expand Down

0 comments on commit 17d2c8a

Please sign in to comment.