From 22a4f7922439d395bb3ff4efeccfb2a183c11b33 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Wed, 13 Aug 2025 21:56:03 -0700 Subject: [PATCH] Fix LogBox dealloc crashing Mac Catalyst (#53259) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53259 delegate.window is not supported in Mac Catalyst, causing a crash in various scenarios such as Metro refresh. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D80189486 fbshipit-source-id: d0e8156f8f95769c114b497f53731876478fb1f4 --- packages/react-native/React/CoreModules/RCTLogBoxView.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/React/CoreModules/RCTLogBoxView.mm b/packages/react-native/React/CoreModules/RCTLogBoxView.mm index 91f5dcfbd3c..fc0f24809ea 100644 --- a/packages/react-native/React/CoreModules/RCTLogBoxView.mm +++ b/packages/react-native/React/CoreModules/RCTLogBoxView.mm @@ -81,7 +81,9 @@ - (void)dealloc { +#if !TARGET_OS_MACCATALYST // sharedApplication.delegate is not available on Mac Catalyst [RCTSharedApplication().delegate.window makeKeyWindow]; +#endif } - (void)show