mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Drop RCT_EXPORT_METHOD from RCTAppState TurboModule (#57676)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57676 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. Reviewed By: cortinico Differential Revision: D113579877 fbshipit-source-id: b12cd86e90fcd323ddf3daa64c832c9d7c918e2e
This commit is contained in:
1 parent
92e8d22d6c
commit
c8c4d6eb5b
1 file changed
+1
-1
@@ -135,7 +135,7 @@ RCT_EXPORT_MODULE()
|
||||
/**
|
||||
* Get the current background/foreground state of the app
|
||||
*/
|
||||
RCT_EXPORT_METHOD(getCurrentAppState : (RCTResponseSenderBlock)callback error : (__unused RCTResponseSenderBlock)error)
|
||||
- (void)getCurrentAppState:(RCTResponseSenderBlock)callback error:(__unused RCTResponseSenderBlock)error
|
||||
{
|
||||
callback(@[ @{@"app_state" : RCTCurrentAppState()} ]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user