From 372ff1345fc7e80108d1793eb4b339e057cc9450 Mon Sep 17 00:00:00 2001 From: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> Date: Fri, 13 Jun 2025 08:45:45 -0500 Subject: [PATCH] Add RN window dimensions patch (#416) Co-authored-by: Ritesh Shukla --- patches/react-native+0.79.2.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 patches/react-native+0.79.2.patch diff --git a/patches/react-native+0.79.2.patch b/patches/react-native+0.79.2.patch new file mode 100644 index 00000000..5eb1c0d9 --- /dev/null +++ b/patches/react-native+0.79.2.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm b/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm +index 6b4fcef..fed256f 100644 +--- a/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm ++++ b/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm +@@ -144,9 +144,10 @@ static BOOL RCTIsIPhoneNotched() + { + UIScreen *mainScreen = UIScreen.mainScreen; + CGSize screenSize = mainScreen.bounds.size; ++ UIView *mainWindow = RCTKeyWindow(); + + // We fallback to screen size if a key window is not found. +- CGSize windowSize = [RCTKeyWindowValuesProxy sharedInstance].windowSize; ++ CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize; + + NSDictionary *dimsWindow = @{ + @"width" : @(windowSize.width),