Skip to content

Commit 902292e

Browse files
authored
[DevSettings] Set correct platform for HMR settings (#628)
1 parent 1b2ac19 commit 902292e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

React/CoreModules/RCTDevSettings.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#import <React/RCTProfile.h>
1818
#import <React/RCTReloadCommand.h>
1919
#import <React/RCTUtils.h>
20+
#import <React/RCTBundleURLProvider.h> // TODO(macOS ISS#2323203)
2021

2122
#import <React/RCTDevMenu.h>
2223

@@ -439,13 +440,14 @@ - (void)setupHotModuleReloadClientIfApplicableForURL:(NSURL *)bundleURL
439440
NSString *const path = [bundleURL.path substringFromIndex:1]; // Strip initial slash.
440441
NSString *const host = bundleURL.host;
441442
NSNumber *const port = bundleURL.port;
443+
// TODO(macOS ISS#2323203) - we could perhaps infer the platform from the bundleURL's query parameters, instead of hardcoding
442444
if (self.bridge) {
443445
[self.bridge enqueueJSCall:@"HMRClient"
444446
method:@"setup"
445-
args:@[ @"ios", path, host, RCTNullIfNil(port), @(YES) ]
447+
args:@[ kRCTPlatformName, path, host, RCTNullIfNil(port), @(YES) ] // TODO(macOS ISS#2323203)
446448
completion:NULL];
447449
} else {
448-
self.invokeJS(@"HMRClient", @"setup", @[ @"ios", path, host, RCTNullIfNil(port), @(YES) ]);
450+
self.invokeJS(@"HMRClient", @"setup", @[ kRCTPlatformName, path, host, RCTNullIfNil(port), @(YES) ]); // TODO(macOS ISS#2323203)
449451
}
450452
}
451453
}

0 commit comments

Comments
 (0)