From c40df8a1d323a0518323608959a2ac1cfb268e53 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Wed, 13 Aug 2025 15:23:30 -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 --- 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 91f5dcfbd3c3..fc0f24809eab 100644 --- a/packages/react-native/React/CoreModules/RCTLogBoxView.mm +++ b/packages/react-native/React/CoreModules/RCTLogBoxView.mm @@ -81,7 +81,9 @@ - (void)layoutSubviews - (void)dealloc { +#if !TARGET_OS_MACCATALYST // sharedApplication.delegate is not available on Mac Catalyst [RCTSharedApplication().delegate.window makeKeyWindow]; +#endif } - (void)show