Skip to content

Commit c4b7586

Browse files
authored
fix: ensure PausedInDebuggerOverlay has message set before presenting (#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 d947e33 commit c4b7586

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
@@ -179,10 +179,10 @@ - (void)showWithMessage:(NSString *)message onResume:(void (^)(void))onResume
179179
[self.alertWindow makeKeyAndVisible];
180180
[self.alertWindow.rootViewController presentViewController:view animated:NO completion:nil];
181181
#else // [macOS]
182-
self.alertWindow.contentViewController = view;
183182
view.message = message;
184183
view.onResume = onResume;
185-
184+
185+
self.alertWindow.contentViewController = view;
186186
NSWindow *parentWindow = RCTKeyWindow();
187187
if (![[parentWindow sheets] doesContain:self->_alertWindow]) {
188188
[parentWindow beginSheet:self.alertWindow completionHandler:^(NSModalResponse returnCode) {

0 commit comments

Comments
 (0)