From dea16416959699a7298485a0b380c21943e221e3 Mon Sep 17 00:00:00 2001 From: Alan Hughes <30924086+alanjhughes@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:20:12 +0100 Subject: [PATCH] Revert performance monitor change (#36) --- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index 771d93ff9d9498..715714574a0516 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -297,7 +297,11 @@ - (void)show [self updateStats]; - [RCTKeyWindow() addSubview:self.container]; + // This change is causing the performance monitor and element inspector to be added to the dev menus UIWindow + // instead of the main app + // [RCTKeyWindow() addSubview:self.container]; + UIWindow *window = RCTSharedApplication().delegate.window; + [window addSubview:self.container]; _uiDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(threadUpdate:)]; [_uiDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];