From 8d8e1b3d4e3243afaeec8aeda3c6f00284993922 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:25:24 -0700 Subject: [PATCH 1/6] fix(0.81, macos): keep the view's shadow color alive On macOS, RCTView declares shadowColor as an assign CGColorRef property, so it kept the color it was given without retaining it. That color is autoreleased, so by the time didUpdateShadow read it, it could already be freed, which crashed. Convert the color to an NSColor as soon as it's set, and keep that instead. Setting it to NULL clears the color. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- packages/react-native/React/Views/RCTView.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/react-native/React/Views/RCTView.m b/packages/react-native/React/Views/RCTView.m index 0a4efc1fff0a..f94888eaf065 100644 --- a/packages/react-native/React/Views/RCTView.m +++ b/packages/react-native/React/Views/RCTView.m @@ -143,6 +143,7 @@ @implementation RCTView { NSTrackingArea *_trackingArea; BOOL _hasMouseOver; BOOL _mouseDownCanMoveWindow; + NSColor *_innerShadowColor; #endif // macOS] NSMutableDictionary *accessibilityActionsNameMap; NSMutableDictionary *accessibilityActionsLabelMap; @@ -731,11 +732,8 @@ - (NSString *)description #if TARGET_OS_OSX // [macOS - (void)setShadowColor:(CGColorRef)shadowColor { - if (_shadowColor != shadowColor) - { - _shadowColor = shadowColor; - [self didUpdateShadow]; - } + _innerShadowColor = shadowColor != NULL ? [NSColor colorWithCGColor:shadowColor] : nil; + [self didUpdateShadow]; } - (void)setShadowOffset:(CGSize)shadowOffset @@ -768,11 +766,7 @@ - (void)setShadowRadius:(CGFloat)shadowRadius -(void)didUpdateShadow { NSShadow *shadow = [NSShadow new]; - NSColor *baseShadowColor = nil; - if (_shadowColor != NULL) { - baseShadowColor = [NSColor colorWithCGColor:_shadowColor]; - } - shadow.shadowColor = [baseShadowColor colorWithAlphaComponent:[self shadowOpacity]]; + shadow.shadowColor = [_innerShadowColor colorWithAlphaComponent:[self shadowOpacity]]; shadow.shadowOffset = [self shadowOffset]; shadow.shadowBlurRadius = [self shadowRadius]; [self setShadow:shadow]; From cfc2fb7c98bbd1243be76848cc8ea83b64ef5e13 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:25:27 -0700 Subject: [PATCH 2/6] fix(0.81, macos): add no-op scroll indicator inset setters to RCTScrollView RCTScrollViewManager exports scrollIndicatorInsets, verticalScrollIndicatorInsets and automaticallyAdjustsScrollIndicatorInsets on every platform, but on macOS RCTScrollView has no setters for them, so setting one from JavaScript crashed. Add no-op setters on macOS. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- .../React/Views/ScrollView/RCTScrollView.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollView.m b/packages/react-native/React/Views/ScrollView/RCTScrollView.m index eb79ff326143..8ebf55d60573 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollView.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollView.m @@ -1505,6 +1505,18 @@ - (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBeh _scrollView.contentInsetAdjustmentBehavior = behavior; _scrollView.contentOffset = contentOffset; } +#else // [macOS] No-op setters, so setting these props from JS doesn't crash +- (void)setScrollIndicatorInsets:(__unused UIEdgeInsets)value +{ +} + +- (void)setVerticalScrollIndicatorInsets:(__unused UIEdgeInsets)value +{ +} + +- (void)setAutomaticallyAdjustsScrollIndicatorInsets:(__unused BOOL)automaticallyAdjusts +{ +} #endif // [macOS] #pragma clang diagnostic pop // [macOS] From 51f77b8c05535a1c4754fba040b8b85d88d1b51c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:25:30 -0700 Subject: [PATCH 3/6] fix(0.81, macos): define the layout direction constants as NSUserInterfaceLayoutDirection values On macOS, RCTUIKit makes UIUserInterfaceLayoutDirection an alias of NSUserInterfaceLayoutDirection, but declared the LeftToRight and RightToLeft constants in a separate, unnamed enum. Comparing a layout direction with them, as RCTTextAttributes.mm does, mixes two enumeration types, which C++20 deprecates and clang reports with -Wdeprecated-anon-enum-enum-conversion. Define the constants as the NSUserInterfaceLayoutDirection values, like the type. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- packages/react-native/React/Base/RCTUIKit.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/react-native/React/Base/RCTUIKit.h b/packages/react-native/React/Base/RCTUIKit.h index 8f1094a71ed4..5212a2d4bcbd 100644 --- a/packages/react-native/React/Base/RCTUIKit.h +++ b/packages/react-native/React/Base/RCTUIKit.h @@ -247,11 +247,8 @@ typedef NS_ENUM(NSInteger, UIViewContentMode) { }; // UIInterface.h/NSUserInterfaceLayout.h -enum : NSInteger -{ - UIUserInterfaceLayoutDirectionLeftToRight = NSUserInterfaceLayoutDirectionLeftToRight, - UIUserInterfaceLayoutDirectionRightToLeft = NSUserInterfaceLayoutDirectionRightToLeft, -}; +#define UIUserInterfaceLayoutDirectionLeftToRight NSUserInterfaceLayoutDirectionLeftToRight +#define UIUserInterfaceLayoutDirectionRightToLeft NSUserInterfaceLayoutDirectionRightToLeft // RCTActivityIndicatorView.h typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) { From 894d20e7b5f7ebc520e2a06323de951365a2495f Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:25:33 -0700 Subject: [PATCH 4/6] fix(0.81): match reportRequestFailed's cancelled type to its BOOL declaration RCTInspectorNetworkReporter.h declares reportRequestFailed:cancelled: with a BOOL parameter, but the implementation took bool. They're the same type on arm64, but on x86_64 macOS and Mac Catalyst BOOL is signed char, so the definition didn't match its declaration and clang warned with -Wmismatched-parameter-types. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- .../Libraries/Network/RCTInspectorNetworkReporter.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Network/RCTInspectorNetworkReporter.mm b/packages/react-native/Libraries/Network/RCTInspectorNetworkReporter.mm index 74d8155832cd..17f6e55093b7 100644 --- a/packages/react-native/Libraries/Network/RCTInspectorNetworkReporter.mm +++ b/packages/react-native/Libraries/Network/RCTInspectorNetworkReporter.mm @@ -126,7 +126,7 @@ + (void)reportResponseEnd:(NSNumber *)requestId encodedDataLength:(int)encodedDa #endif } -+ (void)reportRequestFailed:(NSNumber *)requestId cancelled:(bool)cancelled ++ (void)reportRequestFailed:(NSNumber *)requestId cancelled:(BOOL)cancelled { NetworkReporter::getInstance().reportRequestFailed(requestId.stringValue.UTF8String, cancelled); From 4cd55e14b199009214893d09a8ed1bf67bb0756c Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:25:35 -0700 Subject: [PATCH 5/6] chore(0.81): add a version plan for a patch release Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- .nx/version-plans/version-plan-1792088305769.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .nx/version-plans/version-plan-1792088305769.md diff --git a/.nx/version-plans/version-plan-1792088305769.md b/.nx/version-plans/version-plan-1792088305769.md new file mode 100644 index 000000000000..5621a1a5839f --- /dev/null +++ b/.nx/version-plans/version-plan-1792088305769.md @@ -0,0 +1,5 @@ +--- +__default__: patch +--- + +Fix macOS crashes when setting a shadow color or scroll indicator insets, and two compiler warnings From 40952214f6687804338fa3f7d3442929ae277291 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:41:33 -0700 Subject: [PATCH 6/6] ci(0.81): demote release from `latest` react-native-macos@latest is 0.83 now, so tag 0.81 releases with 0.81-stable instead, as #2801 did for 0.79. Until then, the prepublish check in the NPM Publish (Dry Run) job fails on every 0.81-stable pull request, and would block the next 0.81 release. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- nx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 06f7fc86f307..6b2e8c592e8e 100644 --- a/nx.json +++ b/nx.json @@ -21,7 +21,7 @@ "versionActionsOptions": { "currentVersionResolver": "registry", "currentVersionResolverMetadata": { - "tag": "latest" + "tag": "0.81-stable" } }, "useLegacyVersioning": false