Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 56fcc7f

Browse files
Mohamed Alsadeklouix
authored andcommitted
Back out "Enable Multiple Sheet Presentation in React Native" (facebook#46434)
Summary: Pull Request resolved: facebook#46434 Original commit changeset: daa0cf95edb2 Original Phabricator Diff: D62202475 Changelog: [Internal] revert previous modal presentation improvement Reviewed By: sammy-SC Differential Revision: D62474041 fbshipit-source-id: a4af6b5361dcc482e9bb3c2f45d614f9494f022e
1 parent 63c3508 commit 56fcc7f

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

packages/react-native/React/Views/RCTModalHostViewManager.m

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ - (void)presentModalHostView:(RCTModalHostView *)modalHostView
6464
if (self->_presentationBlock) {
6565
self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock);
6666
} else {
67-
[[self _topMostViewControllerFrom:[modalHostView reactViewController]] presentViewController:viewController
68-
animated:animated
69-
completion:completionBlock];
67+
[[modalHostView reactViewController] presentViewController:viewController
68+
animated:animated
69+
completion:completionBlock];
7070
}
7171
});
7272
}
@@ -107,26 +107,6 @@ - (void)invalidate
107107
_hostViews = nil;
108108
}
109109

110-
#pragma mark - Private
111-
112-
- (UIViewController *)_topMostViewControllerFrom:(UIViewController *)rootViewController
113-
{
114-
UIViewController *topController = rootViewController;
115-
while (topController.presentedViewController) {
116-
topController = topController.presentedViewController;
117-
}
118-
if ([topController isKindOfClass:[UINavigationController class]]) {
119-
UINavigationController *navigationController = (UINavigationController *)topController;
120-
topController = navigationController.visibleViewController;
121-
return [self _topMostViewControllerFrom:topController];
122-
} else if ([topController isKindOfClass:[UITabBarController class]]) {
123-
UITabBarController *tabBarController = (UITabBarController *)topController;
124-
topController = tabBarController.selectedViewController;
125-
return [self _topMostViewControllerFrom:topController];
126-
}
127-
return topController;
128-
}
129-
130110
RCT_EXPORT_VIEW_PROPERTY(animationType, NSString)
131111
RCT_EXPORT_VIEW_PROPERTY(presentationStyle, UIModalPresentationStyle)
132112
RCT_EXPORT_VIEW_PROPERTY(transparent, BOOL)

0 commit comments

Comments
 (0)