Drop RCT_EXPORT_METHOD from RCTStatusBarManager TurboModule (#57686)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57686

Changelog: [Internal]

`RCTStatusBarManager` is a TurboModule: it conforms to `NativeStatusBarManagerIOSSpec` 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 `NativeStatusBarManagerIOSSpec` 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: D113579878

fbshipit-source-id: 377b2383d8f6e124150aa44a4b545f25794a5012
This commit is contained in:
Christoph Purrer authored and meta-codesync[bot] committed 2026-07-27 09:32:49 -07:00
1 parent d9e4908aeb
commit 2cf34f8799
2 files changed
+12 -6

No files matched your search

@@ -17,11 +17,17 @@
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(getHeight : (RCTResponseSenderBlock)callback) {}
- (void)getHeight:(RCTResponseSenderBlock)callback
{
}
RCT_EXPORT_METHOD(setStyle : (NSString *)style animated : (BOOL)animated) {}
- (void)setStyle:(NSString *)style animated:(BOOL)animated
{
}
RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (NSString *)withAnimation) {}
- (void)setHidden:(BOOL)hidden withAnimation:(NSString *)withAnimation
{
}
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants
{
@@ -136,14 +136,14 @@ RCT_EXPORT_MODULE()
[self emitEvent:kStatusBarFrameWillChange forNotification:notification];
}
RCT_EXPORT_METHOD(getHeight : (RCTResponseSenderBlock)callback)
- (void)getHeight:(RCTResponseSenderBlock)callback
{
callback(@[ @{
@"height" : @(RCTUIStatusBarManager().statusBarFrame.size.height),
} ]);
}
RCT_EXPORT_METHOD(setStyle : (NSString *)style animated : (BOOL)animated)
- (void)setStyle:(NSString *)style animated:(BOOL)animated
{
dispatch_async(dispatch_get_main_queue(), ^{
UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle:style];
@@ -159,7 +159,7 @@ RCT_EXPORT_METHOD(setStyle : (NSString *)style animated : (BOOL)animated)
});
}
RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (NSString *)withAnimation)
- (void)setHidden:(BOOL)hidden withAnimation:(NSString *)withAnimation
{
dispatch_async(dispatch_get_main_queue(), ^{
UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation:withAnimation];