diff --git a/React/Base/RCTUtils.m b/React/Base/RCTUtils.m index c00bb283d..ab49299d3 100644 --- a/React/Base/RCTUtils.m +++ b/React/Base/RCTUtils.m @@ -481,9 +481,10 @@ UIViewController *__nullable RCTPresentedViewController(void) } UIViewController *controller = RCTKeyWindow().rootViewController; - - while (controller.presentedViewController) { - controller = controller.presentedViewController; + UIViewController *presentedController = controller.presentedViewController; + while (presentedController && ![presentedController isBeingDismissed]) { + controller = presentedController; + presentedController = controller.presentedViewController; } return controller;