Skip to content

Commit 704b60c

Browse files
authored
fix: Properly clean up RCTDevLoadingView on hide (#2201)
1 parent a87ddb5 commit 704b60c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-native/React/CoreModules/RCTDevLoadingView.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
138138
self->_label.font = [UIFont monospacedDigitSystemFontOfSize:12.0 weight:UIFontWeightRegular];
139139
self->_label.textAlignment = NSTextAlignmentCenter;
140140
#else // [macOS
141-
self->_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20)
141+
self->_window = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 375, 20)
142142
styleMask:NSWindowStyleMaskBorderless
143143
backing:NSBackingStoreBuffered
144144
defer:YES];
@@ -214,6 +214,8 @@ - (void)showMessage:(NSString *)message color:(RCTUIColor *)color backgroundColo
214214
}];
215215
#else // [macOS]
216216
[RCTKeyWindow() endSheet:self->_window];
217+
self->_window = nil;
218+
self->_hiding = false;
217219
#endif // macOS]
218220
});
219221
}

0 commit comments

Comments
 (0)