Skip to content

Commit aa7d633

Browse files
committed
fix: ensure PausedInDebuggerOverlay has message set before presenting (microsoft#2594)
## Summary: RCTUILabel doesn't like it if we set message to nil, which we accidentally did by loading our viewController into a window (which calls viewDidLoad, which creates our label and sets message) before we have set our property. Simple fix to call code in the right order. ## Test Plan: <img width="1392" height="860" alt="image" src="https://github.com/user-attachments/assets/c6158b2c-4f8f-4348-9eb0-e863ec72a9e1" />
1 parent 7d67b4f commit aa7d633

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native/React/DevSupport/RCTPausedInDebuggerOverlayController.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ - (void)showWithMessage:(NSString *)message onResume:(void (^)(void))onResume
175175
[self.alertWindow makeKeyAndVisible];
176176
[self.alertWindow.rootViewController presentViewController:view animated:NO completion:nil];
177177
#else // [macOS]
178-
self.alertWindow.contentViewController = view;
179178
view.message = message;
180179
view.onResume = onResume;
181-
180+
181+
self.alertWindow.contentViewController = view;
182182
NSWindow *parentWindow = RCTKeyWindow();
183183
if (![[parentWindow sheets] doesContain:self->_alertWindow]) {
184184
[parentWindow beginSheet:self.alertWindow completionHandler:^(NSModalResponse returnCode) {

0 commit comments

Comments
 (0)