Skip to content

Commit fd68686

Browse files
authored
Merge pull request #18 from callstackincubator/fix/reload-sandbox-on-bundle-source-change
fix(ios): reload sandbox when jsBundleSource prop changes
2 parents 3e06e48 + 31d49c3 commit fd68686

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)