Skip to content

Commit aeea051

Browse files
Drop RCT_EXPORT_METHOD from RCTClipboard TurboModule
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
1 parent 2c4d421 commit aeea051

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ - (dispatch_queue_t)methodQueue
2626
return dispatch_get_main_queue();
2727
}
2828

29-
RCT_EXPORT_METHOD(setString : (NSString *)content)
29+
- (void)setString:(NSString *)content
3030
{
3131
#if !TARGET_OS_TV
3232
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
3333
clipboard.string = (content ?: @"");
3434
#endif
3535
}
3636

37-
RCT_EXPORT_METHOD(getString : (RCTPromiseResolveBlock)resolve reject : (__unused RCTPromiseRejectBlock)reject)
37+
- (void)getString:(RCTPromiseResolveBlock)resolve reject:(__unused RCTPromiseRejectBlock)reject
3838
{
3939
#if !TARGET_OS_TV
4040
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];

0 commit comments

Comments
 (0)