From 34cd195d9fbd075a161afbfac842f896355991e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Fri, 21 Jun 2024 08:27:50 -0700 Subject: [PATCH] fix: retrieve statusbar size using RCTUIStatusBarManager (#45103) Summary: This PR changes the call from `RCTSharedApplication()` to retrieve the status bar size using the `RCTUIStatusBarManager()` method, a way which supports multi-window apps. ## Changelog: [IOS] [FIXED] - Retrieve status bar size using RCTUIStatusBarManager Pull Request resolved: https://github.com/facebook/react-native/pull/45103 Test Plan: Check if the perf menu pops up in the correct spot. Reviewed By: javache Differential Revision: D58868503 Pulled By: cipolleschi fbshipit-source-id: db5fc80a712a8a18a2863cdfbbe44f48bafe9fc3 --- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index 023a5311db2..13872eac556 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -171,7 +171,7 @@ RCT_EXPORT_MODULE() - (UIView *)container { if (!_container) { - CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size; + CGSize statusBarSize = RCTUIStatusBarManager().statusBarFrame.size; CGFloat statusBarHeight = statusBarSize.height; _container = [[UIView alloc] initWithFrame:CGRectMake(10, statusBarHeight, 180, RCTPerfMonitorBarHeight)]; _container.layer.borderWidth = 2;