mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Enable Multiple Sheet Presentation in React Native" (#46434)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1e07ac1d32
commit
080c82e70f
@@ -64,9 +64,9 @@ RCT_EXPORT_MODULE()
|
||||
if (self->_presentationBlock) {
|
||||
self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock);
|
||||
} else {
|
||||
[[self _topMostViewControllerFrom:[modalHostView reactViewController]] presentViewController:viewController
|
||||
animated:animated
|
||||
completion:completionBlock];
|
||||
[[modalHostView reactViewController] presentViewController:viewController
|
||||
animated:animated
|
||||
completion:completionBlock];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -107,26 +107,6 @@ RCT_EXPORT_MODULE()
|
||||
_hostViews = nil;
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(animationType, NSString)
|
||||
RCT_EXPORT_VIEW_PROPERTY(presentationStyle, UIModalPresentationStyle)
|
||||
RCT_EXPORT_VIEW_PROPERTY(transparent, BOOL)
|
||||
|
||||
Reference in New Issue
Block a user