Skip to content

Commit 0976030

Browse files
Drop RCT_EXPORT_METHOD from RCTAppState TurboModule (#57676)
Summary: Changelog: [Internal] `RCTAppState` is a TurboModule: it conforms to `NativeAppStateSpec` 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 `NativeAppStateSpec` 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: D113579877
1 parent a5ca1a7 commit 0976030

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ - (void)handleAppStateDidChange:(NSNotification *)notification
135135
/**
136136
* Get the current background/foreground state of the app
137137
*/
138-
RCT_EXPORT_METHOD(getCurrentAppState : (RCTResponseSenderBlock)callback error : (__unused RCTResponseSenderBlock)error)
138+
- (void)getCurrentAppState:(RCTResponseSenderBlock)callback error:(__unused RCTResponseSenderBlock)error
139139
{
140140
callback(@[ @{@"app_state" : RCTCurrentAppState()} ]);
141141
}

0 commit comments

Comments
 (0)