Skip to content

Commit 9e71c44

Browse files
shwantonmeta-codesync[bot]
authored andcommitted
Downgrade RCTStatusBarManager error to a warning under VC-based status bar (#57631)
Summary: Pull Request resolved: #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
1 parent 5421c5e commit 9e71c44

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
148148
dispatch_async(dispatch_get_main_queue(), ^{
149149
UIStatusBarStyle statusBarStyle = [RCTConvert UIStatusBarStyle:style];
150150
if (RCTViewControllerBasedStatusBarAppearance()) {
151-
RCTLogError(@"RCTStatusBarManager module requires that the \
152-
UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO");
151+
RCTLogWarn(@"RCTStatusBarManager is a no-op when \
152+
UIViewControllerBasedStatusBarAppearance is YES; set the status bar from your view controller instead");
153153
} else {
154154
#pragma clang diagnostic push
155155
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -164,8 +164,8 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
164164
dispatch_async(dispatch_get_main_queue(), ^{
165165
UIStatusBarAnimation animation = [RCTConvert UIStatusBarAnimation:withAnimation];
166166
if (RCTViewControllerBasedStatusBarAppearance()) {
167-
RCTLogError(@"RCTStatusBarManager module requires that the \
168-
UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO");
167+
RCTLogWarn(@"RCTStatusBarManager is a no-op when \
168+
UIViewControllerBasedStatusBarAppearance is YES; set the status bar from your view controller instead");
169169
} else {
170170
#pragma clang diagnostic push
171171
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

0 commit comments

Comments
 (0)