From 051702f336aeb4b6ff8e8e218c0b702541ce080d 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 RCTI18nManager TurboModule (#57685) Summary: Pull Request resolved: https://github.com/react/react-native/pull/57685 Changelog: [Internal] `RCTI18nManager` is a TurboModule: it conforms to `NativeI18nManagerSpec` 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 `NativeI18nManagerSpec` 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: D113579882 fbshipit-source-id: 132391150a623562cb6c6247d89da34f77ed4434 --- packages/react-native/React/CoreModules/RCTI18nManager.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTI18nManager.mm b/packages/react-native/React/CoreModules/RCTI18nManager.mm index 7d3b9eaa11c..e24c2e60ff6 100644 --- a/packages/react-native/React/CoreModules/RCTI18nManager.mm +++ b/packages/react-native/React/CoreModules/RCTI18nManager.mm @@ -26,17 +26,17 @@ RCT_EXPORT_MODULE() return NO; } -RCT_EXPORT_METHOD(allowRTL : (BOOL)value) +- (void)allowRTL:(BOOL)value { [[RCTI18nUtil sharedInstance] allowRTL:value]; } -RCT_EXPORT_METHOD(forceRTL : (BOOL)value) +- (void)forceRTL:(BOOL)value { [[RCTI18nUtil sharedInstance] forceRTL:value]; } -RCT_EXPORT_METHOD(swapLeftAndRightInRTL : (BOOL)value) +- (void)swapLeftAndRightInRTL:(BOOL)value { [[RCTI18nUtil sharedInstance] swapLeftAndRightInRTL:value]; }