diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm index 9205fa3d21125c..b53de29651ccc0 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm @@ -104,7 +104,6 @@ @implementation RCTModalHostViewComponentView { BOOL _shouldAnimatePresentation; BOOL _shouldPresent; BOOL _isPresented; - UIView *_modalContentsSnapshot; } - (instancetype)initWithFrame:(CGRect)frame @@ -141,7 +140,6 @@ - (void)dismissViewController:(UIViewController *)modalViewController animated:(BOOL)animated completion:(void (^)(void))completion { - _modalContentsSnapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO]; [modalViewController dismissViewControllerAnimated:animated completion:completion]; } @@ -167,8 +165,7 @@ - (void)ensurePresentedOnlyIfNeeded _isPresented = NO; // To animate dismissal of view controller, snapshot of // view hierarchy needs to be added to the UIViewController. - UIView *snapshot = _modalContentsSnapshot; - + UIView *snapshot = [self.viewController.view snapshotViewAfterScreenUpdates:NO]; if (_shouldPresent) { [self.viewController.view addSubview:snapshot]; }