From 4800be1d8b52fbac0fcba97cd05729a5faf7aeb2 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Mon, 27 Jul 2026 09:32:49 -0700 Subject: [PATCH] Drop RCT_EXPORT_METHOD from RCTLogBox TurboModule (#57677) Summary: Pull Request resolved: https://github.com/react/react-native/pull/57677 Changelog: [Internal] `RCTLogBox` is a TurboModule: it conforms to `NativeLogBoxSpec` 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 `NativeLogBoxSpec` 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. Reviewed By: cortinico Differential Revision: D113579879 fbshipit-source-id: 4daee6576539c65c54394e9250e1799f611099b2 --- packages/react-native/React/CoreModules/RCTLogBox.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTLogBox.mm b/packages/react-native/React/CoreModules/RCTLogBox.mm index d9663afb29c..7e8be47170d 100644 --- a/packages/react-native/React/CoreModules/RCTLogBox.mm +++ b/packages/react-native/React/CoreModules/RCTLogBox.mm @@ -39,7 +39,7 @@ RCT_EXPORT_MODULE() _bridgelessSurfacePresenter = surfacePresenter; } -RCT_EXPORT_METHOD(show) +- (void)show { if (RCTRedBoxGetEnabled()) { __weak RCTLogBox *weakSelf = self; @@ -63,7 +63,7 @@ RCT_EXPORT_METHOD(show) } } -RCT_EXPORT_METHOD(hide) +- (void)hide { if (RCTRedBoxGetEnabled()) { __weak RCTLogBox *weakSelf = self;