Skip to content

Commit 760d64f

Browse files
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
1 parent 3caeff6 commit 760d64f

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ - (void)presentViewController:(UIViewController *)alertController
7676
[parentViewController presentViewController:alertController animated:YES completion:nil];
7777
}
7878

79-
RCT_EXPORT_METHOD(
80-
showActionSheetWithOptions : (JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)
81-
options callback : (RCTResponseSenderBlock)callback)
79+
- (void)showActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)options
80+
callback:(RCTResponseSenderBlock)callback
8281
{
8382
if (RCTRunningInAppExtension()) {
8483
RCTLogError(@"Unable to show action sheet from app extension");
@@ -219,7 +218,7 @@ - (void)presentViewController:(UIViewController *)alertController
219218
});
220219
}
221220

222-
RCT_EXPORT_METHOD(dismissActionSheet)
221+
- (void)dismissActionSheet
223222
{
224223
if (_alertControllers.count == 0) {
225224
RCTLogWarn(@"Unable to dismiss action sheet");
@@ -232,10 +231,10 @@ - (void)presentViewController:(UIViewController *)alertController
232231
});
233232
}
234233

235-
RCT_EXPORT_METHOD(
236-
showShareActionSheetWithOptions : (JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)
237-
options failureCallback : (RCTResponseSenderBlock)failureCallback successCallback : (RCTResponseSenderBlock)
238-
successCallback)
234+
- (void)showShareActionSheetWithOptions:
235+
(JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options
236+
failureCallback:(RCTResponseSenderBlock)failureCallback
237+
successCallback:(RCTResponseSenderBlock)successCallback
239238
{
240239
if (RCTRunningInAppExtension()) {
241240
RCTLogError(@"Unable to show action sheet from app extension");

0 commit comments

Comments
 (0)