Skip to content

Commit 90fc4ea

Browse files
Address PR comments
1 parent b5ab849 commit 90fc4ea

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

packages/react-native/React/Base/RCTUtils.mm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,7 @@ CGSize RCTSwitchSize(void)
451451
static dispatch_once_t onceToken;
452452
dispatch_once(&onceToken, ^{
453453
RCTUnsafeExecuteOnMainQueueSync(^{
454-
#if !TARGET_OS_OSX // [macOS]
455-
rctSwitchSize = [UISwitch new].intrinsicContentSize;
456-
#else // [macOS
457-
rctSwitchSize = [NSSwitch new].intrinsicContentSize;
458-
#endif // macOS]
454+
rctSwitchSize = [RCTPlatformSwitch new].intrinsicContentSize; // [macOS]
459455
});
460456
});
461457
return rctSwitchSize;

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,9 +2318,7 @@ - (void)transferVisualPropertiesFromView:(RCTPlatformView *)sourceView toView:(R
23182318
// corner
23192319
destinationView.layer.cornerRadius = sourceView.layer.cornerRadius;
23202320
sourceView.layer.cornerRadius = 0;
2321-
#if !TARGET_OS_OSX // [macOS]
23222321
destinationView.layer.cornerCurve = sourceView.layer.cornerCurve;
2323-
#endif // [macOS]
23242322

23252323
// custom layers
23262324
if (_borderLayer != nullptr) {

packages/react-native/React/RCTUIKit/RCTUIKitCompat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,13 @@ typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) {
225225
@compatibility_alias RCTPlatformWindow UIWindow;
226226
@compatibility_alias RCTPlatformViewController UIViewController;
227227
@compatibility_alias RCTUIApplication UIApplication;
228+
@compatibility_alias RCTPlatformSwitch UISwitch;
228229
#else
229230
@compatibility_alias RCTPlatformApplication NSApplication;
230231
@compatibility_alias RCTPlatformWindow NSWindow;
231232
@compatibility_alias RCTPlatformViewController NSViewController;
232233
@compatibility_alias RCTUIApplication NSApplication;
234+
@compatibility_alias RCTPlatformSwitch NSSwitch;
233235
#endif
234236

235237
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)