From cac973e8a34ac5a84dd22a09f35d9fc73a3016ae Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 24 Jul 2026 18:36:49 -0700 Subject: [PATCH 1/4] Drop RCT_EXPORT_METHOD from RCTClipboard TurboModule (#57671) Summary: Changelog: [Internal] `RCTClipboard` is a TurboModule: it conforms to `NativeClipboardSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeClipboardSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Differential Revision: D113568495 --- packages/react-native/React/CoreModules/RCTClipboard.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTClipboard.mm b/packages/react-native/React/CoreModules/RCTClipboard.mm index f057c34f704c..ab5aea968ff7 100644 --- a/packages/react-native/React/CoreModules/RCTClipboard.mm +++ b/packages/react-native/React/CoreModules/RCTClipboard.mm @@ -26,7 +26,7 @@ - (dispatch_queue_t)methodQueue return dispatch_get_main_queue(); } -RCT_EXPORT_METHOD(setString : (NSString *)content) +- (void)setString:(NSString *)content { #if !TARGET_OS_TV UIPasteboard *clipboard = [UIPasteboard generalPasteboard]; @@ -34,7 +34,7 @@ - (dispatch_queue_t)methodQueue #endif } -RCT_EXPORT_METHOD(getString : (RCTPromiseResolveBlock)resolve reject : (__unused RCTPromiseRejectBlock)reject) +- (void)getString:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject { #if !TARGET_OS_TV UIPasteboard *clipboard = [UIPasteboard generalPasteboard]; From 325541b76db90e479d0d8b8a247486c27cb9f365 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 24 Jul 2026 18:36:49 -0700 Subject: [PATCH 2/4] Drop RCT_EXPORT_METHOD from RCTAccessibilityManager TurboModule Summary: Changelog: [Internal] `RCTAccessibilityManager` is a TurboModule: it conforms to `NativeAccessibilityManagerSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeAccessibilityManagerSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Differential Revision: D113579886 --- .../CoreModules/RCTAccessibilityManager.mm | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index 19895271f141..29b03e6c1c79 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -274,9 +274,8 @@ - (void)setMultipliers:(NSDictionary *)multipliers return _multipliers; } -RCT_EXPORT_METHOD( - setAccessibilityContentSizeMultipliers : ( - JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers &)JSMultipliers) +- (void)setAccessibilityContentSizeMultipliers: + (JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers &)JSMultipliers { NSMutableDictionary *multipliers = [NSMutableDictionary new]; setMultipliers(multipliers, UIContentSizeCategoryExtraSmall, JSMultipliers.extraSmall()); @@ -308,7 +307,7 @@ static void setMultipliers( } } -RCT_EXPORT_METHOD(setAccessibilityFocus : (double)reactTag) +- (void)setAccessibilityFocus:(double)reactTag { dispatch_async(dispatch_get_main_queue(), ^{ UIView *view = [self.viewRegistry_DEPRECATED viewForReactTag:@(reactTag)]; @@ -316,14 +315,16 @@ static void setMultipliers( }); } -RCT_EXPORT_METHOD(announceForAccessibility : (NSString *)announcement) +- (void)announceForAccessibility:(NSString *)announcement { UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, announcement); } -RCT_EXPORT_METHOD( - announceForAccessibilityWithOptions : (NSString *)announcement options : ( - JS::NativeAccessibilityManager::SpecAnnounceForAccessibilityWithOptionsOptions &)options) +- (void) + announceForAccessibilityWithOptions:(NSString *)announcement + options: + (JS::NativeAccessibilityManager::SpecAnnounceForAccessibilityWithOptionsOptions &) + options { NSMutableDictionary *attrsDictionary = [NSMutableDictionary new]; if (options.queue()) { @@ -356,47 +357,41 @@ static void setMultipliers( } } -RCT_EXPORT_METHOD(getMultiplier : (RCTResponseSenderBlock)callback) +- (void)getMultiplier:(RCTResponseSenderBlock)callback { if (callback) { callback(@[ @(self.multiplier) ]); } } -RCT_EXPORT_METHOD( - getCurrentBoldTextState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentBoldTextState:(RCTResponseSenderBlock)onSuccess onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isBoldTextEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentGrayscaleState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentGrayscaleState:(RCTResponseSenderBlock)onSuccess onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isGrayscaleEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentInvertColorsState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentInvertColorsState:(RCTResponseSenderBlock)onSuccess onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isInvertColorsEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentReduceMotionState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentReduceMotionState:(RCTResponseSenderBlock)onSuccess onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isReduceMotionEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentDarkerSystemColorsState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock) - onError) +- (void)getCurrentDarkerSystemColorsState:(RCTResponseSenderBlock)onSuccess + onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isDarkerSystemColorsEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentPrefersCrossFadeTransitionsState : (RCTResponseSenderBlock) - onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentPrefersCrossFadeTransitionsState:(RCTResponseSenderBlock)onSuccess + onError:(__unused RCTResponseSenderBlock)onError { if (@available(iOS 14.0, *)) { onSuccess(@[ @(UIAccessibilityPrefersCrossFadeTransitions()) ]); @@ -405,15 +400,13 @@ static void setMultipliers( } } -RCT_EXPORT_METHOD( - getCurrentReduceTransparencyState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock) - onError) +- (void)getCurrentReduceTransparencyState:(RCTResponseSenderBlock)onSuccess + onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isReduceTransparencyEnabled) ]); } -RCT_EXPORT_METHOD( - getCurrentVoiceOverState : (RCTResponseSenderBlock)onSuccess onError : (__unused RCTResponseSenderBlock)onError) +- (void)getCurrentVoiceOverState:(RCTResponseSenderBlock)onSuccess onError:(__unused RCTResponseSenderBlock)onError { onSuccess(@[ @(_isVoiceOverEnabled) ]); } From 2845601406f317308c0862aefa8bc7c7b0538e82 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 24 Jul 2026 18:36:49 -0700 Subject: [PATCH 3/4] Drop RCT_EXPORT_METHOD from RCTActionSheetManager TurboModule (#57673) Summary: Changelog: [Internal] `RCTActionSheetManager` is a TurboModule: it conforms to `NativeActionSheetManagerSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeActionSheetManagerSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Differential Revision: D113579871 --- .../React/CoreModules/RCTActionSheetManager.mm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm index 360b366ccc3e..41150ac877b0 100644 --- a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm +++ b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm @@ -76,9 +76,8 @@ - (void)presentViewController:(UIViewController *)alertController [parentViewController presentViewController:alertController animated:YES completion:nil]; } -RCT_EXPORT_METHOD( - showActionSheetWithOptions : (JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &) - options callback : (RCTResponseSenderBlock)callback) +- (void)showActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)options + callback:(RCTResponseSenderBlock)callback { if (RCTRunningInAppExtension()) { RCTLogError(@"Unable to show action sheet from app extension"); @@ -219,7 +218,7 @@ - (void)presentViewController:(UIViewController *)alertController }); } -RCT_EXPORT_METHOD(dismissActionSheet) +- (void)dismissActionSheet { if (_alertControllers.count == 0) { RCTLogWarn(@"Unable to dismiss action sheet"); @@ -232,10 +231,10 @@ - (void)presentViewController:(UIViewController *)alertController }); } -RCT_EXPORT_METHOD( - showShareActionSheetWithOptions : (JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &) - options failureCallback : (RCTResponseSenderBlock)failureCallback successCallback : (RCTResponseSenderBlock) - successCallback) +- (void)showShareActionSheetWithOptions: + (JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options + failureCallback:(RCTResponseSenderBlock)failureCallback + successCallback:(RCTResponseSenderBlock)successCallback { if (RCTRunningInAppExtension()) { RCTLogError(@"Unable to show action sheet from app extension"); From 7665d561fce20fd0b743d8518c60666b905d934a Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Fri, 24 Jul 2026 18:36:49 -0700 Subject: [PATCH 4/4] Drop RCT_EXPORT_METHOD from RCTAlertManager TurboModule (#57675) Summary: Changelog: [Internal] `RCTAlertManager` is a TurboModule: it conforms to `NativeAlertManagerSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeAlertManagerSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Differential Revision: D113579876 --- packages/react-native/React/CoreModules/RCTAlertManager.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 8dbe57b90ba3..2d9e8290807b 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -65,7 +65,7 @@ - (void)invalidate * The key from the `buttons` dictionary is passed back in the callback on click. * Buttons are displayed in the order they are specified. */ -RCT_EXPORT_METHOD(alertWithArgs : (JS::NativeAlertManager::Args &)args callback : (RCTResponseSenderBlock)callback) +- (void)alertWithArgs:(JS::NativeAlertManager::Args &)args callback:(RCTResponseSenderBlock)callback { NSString *title = [RCTConvert NSString:args.title()]; NSString *message = [RCTConvert NSString:args.message()];