Skip to content

Commit 94a166a

Browse files
CopilotSaadnajmi
andcommitted
Add clarifying comments to bundler configuration logic
Co-authored-by: Saadnajmi <[email protected]>
1 parent e47ad76 commit 94a166a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-native/React/CoreModules/RCTDevMenu.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,18 +442,21 @@ - (void)setDefaultJSBundle
442442
NSString *port = portTextField.stringValue;
443443
NSString *bundleRoot = entrypointTextField.stringValue;
444444

445+
// If both IP and port are empty, reset to default
445446
if (ipAddress.length == 0 && port.length == 0) {
446447
[weakSelf setDefaultJSBundle];
447448
return;
448449
}
449450

451+
// Parse and validate port number
450452
NSNumberFormatter *formatter = [NSNumberFormatter new];
451453
formatter.numberStyle = NSNumberFormatterDecimalStyle;
452454
NSNumber *portNumber = [formatter numberFromString:port];
453455
if (portNumber == nil) {
454456
portNumber = [NSNumber numberWithInt:RCT_METRO_PORT];
455457
}
456458

459+
// Set the bundler location - matches iOS behavior
457460
[RCTBundleURLProvider sharedSettings].jsLocation =
458461
[NSString stringWithFormat:@"%@:%d", ipAddress, portNumber.intValue];
459462

0 commit comments

Comments
 (0)