Back out "Enable Multiple Sheet Presentation in React Native" (#46433)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46433

Original commit changeset: 53667cf1a75e

Original Phabricator Diff: D62143463

Changelog: [Internal]  revert previous modal presentation improvement

Reviewed By: sammy-SC

Differential Revision: D62474039

fbshipit-source-id: b510c0460c06ab9d595d414d4ea32acd224871bc
This commit is contained in:
Mohamed Alsadek
2024-09-11 04:20:50 -07:00
committed by Facebook GitHub Bot
parent 080c82e70f
commit b3f4d54786
@@ -134,9 +134,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
completion:(void (^)(void))completion
{
UIViewController *controller = [self reactViewController];
[[self _topMostViewControllerFrom:controller] presentViewController:modalViewController
animated:animated
completion:completion];
[controller presentViewController:modalViewController animated:animated completion:completion];
}
- (void)dismissViewController:(UIViewController *)modalViewController
@@ -276,26 +274,6 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
[childComponentView removeFromSuperview];
}
#pragma mark - Private
- (UIViewController *)_topMostViewControllerFrom:(UIViewController *)rootViewController
{
UIViewController *topController = rootViewController;
while (topController.presentedViewController) {
topController = topController.presentedViewController;
}
if ([topController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigationController = (UINavigationController *)topController;
topController = navigationController.visibleViewController;
return [self _topMostViewControllerFrom:topController];
} else if ([topController isKindOfClass:[UITabBarController class]]) {
UITabBarController *tabBarController = (UITabBarController *)topController;
topController = tabBarController.selectedViewController;
return [self _topMostViewControllerFrom:topController];
}
return topController;
}
@end
#ifdef __cplusplus