Skip to content

Commit

Permalink
Prevent DevLauncherController from removing fabric root view
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed May 26, 2023
1 parent c4409fb commit 369e701
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/expo-dev-launcher/ios/EXDevLauncherController.m
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,18 @@ - (void)onAppContentDidAppear
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTContentDidAppearNotification object:nil];

dispatch_async(dispatch_get_main_queue(), ^{
#ifdef RCT_NEW_ARCH_ENABLED
#define EXPECTED_ROOT_VIEW RCTRootComponentView
#else
#define EXPECTED_ROOT_VIEW RCTRootView
#endif
NSArray<UIView *> *views = [[[self->_window rootViewController] view] subviews];
for (UIView *view in views) {
if (![view isKindOfClass:[RCTRootContentView class]]) {
if (![view isKindOfClass:[EXPECTED_ROOT_VIEW class]]) {
[view removeFromSuperview];
}
}
#undef EXPECTED_ROOT_VIEW
});
}

Expand Down

0 comments on commit 369e701

Please sign in to comment.