fix(ios): Reload sandbox when jsBundleSource changes#17
Closed
papay0 wants to merge 1 commit intocallstackincubator:mainfrom
Closed
fix(ios): Reload sandbox when jsBundleSource changes#17papay0 wants to merge 1 commit intocallstackincubator:mainfrom
papay0 wants to merge 1 commit intocallstackincubator:mainfrom
Conversation
Previously, changing the `jsBundleSource` prop would update the delegate's bundle URL but not trigger a reload of the React Native view. This caused the sandbox to continue showing the previously loaded bundle's content. The fix: 1. Track when `jsBundleSource` changes in `updateProps` 2. Set `reactNativeFactory = nil` to destroy the cached factory 3. Call `scheduleReactViewLoad` to create a new factory with the new bundle This ensures that loading different bundle URLs (e.g., different mini-apps) correctly loads fresh content each time.
CAMOBAP
reviewed
Feb 17, 2026
Comment on lines
+104
to
+106
| if (bundleSourceChanged) { | ||
| self.reactNativeFactory = nil; | ||
| [self scheduleReactViewLoad]; |
Collaborator
There was a problem hiding this comment.
Thanks for contribution
Probably recreating factory is overkill here, we simply should reload updated jsBundeUrl i.e. something like RCTTriggerReloadCommandListeners or [RCTBridge reloadWithReason:] would be better
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where changing the
jsBundleSourceprop does not reload the sandbox with the new bundle. Previously, when switching between different bundle URLs (e.g., loading different mini-apps), the sandbox would continue showing the first loaded bundle's content.The Problem
In
SandboxReactNativeViewComponentView.mm, theupdatePropsmethod:jsBundleSourceproperty when it changesscheduleReactViewLoadloadReactNativeViewreuses the existingRCTReactNativeFactorywhich has already loaded the old bundleThe Fix
jsBundleSourcechangesself.reactNativeFactory = nilto destroy the cached factoryscheduleReactViewLoadto create a new factory with the new bundle URLTest Plan
Related Issues
This is a critical bug for any use case involving dynamic bundle loading (e.g., mini-app platforms, code push scenarios).