From 9e71c443acb0cb8a865862dac1281fa6dd8bf83b Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Wed, 22 Jul 2026 13:49:13 -0700 Subject: [PATCH] Downgrade RCTStatusBarManager error to a warning under VC-based status bar (#57631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `` 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 --- .../react-native/React/CoreModules/RCTStatusBarManager.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm index b3e2c7e16db..d8152818901 100644 --- a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm +++ b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm @@ -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"