Skip to content

Commit 6042de4

Browse files
Mehdi Mulanifacebook-github-bot
Mehdi Mulani
authored andcommitted
Improve changing bundler support
Summary: This makes it so that you don't have to specify the package to the bundle. When you don't specify it, it will use the default bundle that is chosen when the app starts. Reviewed By: PeteTheHeat Differential Revision: D15742001 fbshipit-source-id: cd5906a66d04eea308dbc0516bc1fec60caed6bb
1 parent 9cea760 commit 6042de4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

React/DevSupport/RCTDevMenu.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ - (void)setDefaultJSBundle {
314314
UITextField * portTextField = textfields[1];
315315
UITextField * bundleRootTextField = textfields[2];
316316
NSString * bundleRoot = bundleRootTextField.text;
317-
if(bundleRoot.length == 0){
318-
bundleRoot = @"index";
319-
}
320317
if(ipTextField.text.length == 0 && portTextField.text.length == 0) {
321318
[weakSelf setDefaultJSBundle];
322319
return;
@@ -331,7 +328,10 @@ - (void)setDefaultJSBundle {
331328
ipTextField.text, portNumber.intValue];
332329
__strong RCTBridge *strongBridge = bridge;
333330
if (strongBridge) {
334-
strongBridge.bundleURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:bundleRoot fallbackResource:nil];
331+
NSURL *bundleURL = bundleRoot.length
332+
? [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:bundleRoot fallbackResource:nil]
333+
: [strongBridge.delegate sourceURLForBridge:strongBridge];
334+
strongBridge.bundleURL = bundleURL;
335335
[strongBridge reload];
336336
}
337337
}]];

0 commit comments

Comments
 (0)