Downgrade RCTStatusBarManager error to a warning under VC-based status bar (#57631)

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

`RCTStatusBarManager`'s `setStyle:` and `setHidden:` already no-op when
`UIViewControllerBasedStatusBarAppearance` is `YES`. Currently this path emits
`RCTLogError`, which redboxes in dev and logs a soft error in release — even
though the call is an expected no-op when the view controller owns the status bar.

Downgrade to `RCTLogWarn` with a more accurate message so apps adopting
VC-based status bar appearance aren't flooded with spurious errors on every
`StatusBar.setBarStyle` / `setHidden` call or `<StatusBar>` mount.

No behavior change; the methods remain no-ops under the flag.

Changelog: [iOS][Changed] - Downgrade RCTStatusBarManager error to a warning when UIViewControllerBasedStatusBarAppearance is YES

Reviewed By: cipolleschi

Differential Revision: D113043635

fbshipit-source-id: 95224d7beb8e52daf4f29986e7ff5ff1ec4da60b
This commit is contained in:
Shawn Dempsey authored and meta-codesync[bot] committed 2026-07-22 13:49:13 -07:00
1 parent 5421c5eb37
commit 9e71c443ac
1 file changed
+4 -4
@@ -148,8 +148,8 @@ RCT_EXPORT_METHOD(setStyle : (NSString *)style animated : (BOOL)animated)
dispatch_async(dispatch_get_main_queue(), ^{
UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle:style];
if (RCTViewControllerBasedStatusBarAppearance()) {
RCTLogError(@"RCTStatusBarManager module requires that the \
UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO");
RCTLogWarn(@"RCTStatusBarManager is a no-op when \
UIViewControllerBasedStatusBarAppearance is YES; set the status bar from your view controller instead");
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -164,8 +164,8 @@ RCT_EXPORT_METHOD(setHidden : (BOOL)hidden withAnimation : (NSString *)withAnima
dispatch_async(dispatch_get_main_queue(), ^{
UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation:withAnimation];
if (RCTViewControllerBasedStatusBarAppearance()) {
RCTLogError(@"RCTStatusBarManager module requires that the \
UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO");
RCTLogWarn(@"RCTStatusBarManager is a no-op when \
UIViewControllerBasedStatusBarAppearance is YES; set the status bar from your view controller instead");
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"