Skip to content

Commit 31d49c3

Browse files
CAMOBAPcursoragent
andcommitted
fix(ios): reload sandbox when jsBundleSource prop changes
RCTHost is initialized with a bundleURLProvider closure that calls the delegate's bundleURL on every reload. Trigger host reload instead of recreating the entire factory to pick up the new bundle URL. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3e06e48 commit 31d49c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native-sandbox/ios/SandboxReactNativeViewComponentView.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import <React/RCTConversions.h>
1010
#import <React/RCTFabricComponentsPlugins.h>
1111
#import <React/RCTFollyConvert.h>
12+
#import <ReactCommon/RCTHost+Internal.h>
1213
#import <ReactCommon/RCTHost.h>
1314

1415
#import "SandboxReactNativeDelegate.h"
@@ -74,6 +75,10 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
7475

7576
if (oldViewProps.jsBundleSource != newViewProps.jsBundleSource) {
7677
[self.reactNativeDelegate setJsBundleSource:newViewProps.jsBundleSource];
78+
RCTHost *host = self.reactNativeFactory.rootViewFactory.reactHost;
79+
if (host) {
80+
[host reload];
81+
}
7782
}
7883

7984
if (oldViewProps.allowedTurboModules != newViewProps.allowedTurboModules) {

0 commit comments

Comments
 (0)