@@ -36,12 +36,7 @@ @interface RNSScreenStackView () <
36
36
UINavigationControllerDelegate,
37
37
UIAdaptivePresentationControllerDelegate,
38
38
UIGestureRecognizerDelegate,
39
- UIViewControllerTransitioningDelegate
40
- #ifdef RCT_NEW_ARCH_ENABLED
41
- ,
42
- RCTMountingTransactionObserving
43
- #endif
44
- >
39
+ UIViewControllerTransitioningDelegate>
45
40
46
41
@property (nonatomic ) NSMutableArray <UIViewController *> *presentedModals;
47
42
@property (nonatomic ) BOOL updatingModals;
@@ -1125,13 +1120,15 @@ - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompone
1125
1120
- (void )unmountChildComponentView : (UIView<RCTComponentViewProtocol> *)childComponentView index : (NSInteger )index
1126
1121
{
1127
1122
RNSScreenView *screenChildComponent = (RNSScreenView *)childComponentView;
1123
+
1128
1124
// We should only do a snapshot of a screen that is on the top.
1129
1125
// We also check `_presentedModals` since if you push 2 modals, second one is not a "child" of _controller.
1130
1126
// Also, when dissmised with a gesture, the screen already is not under the window, so we don't need to apply
1131
1127
// snapshot.
1132
1128
if (screenChildComponent.window != nil &&
1133
1129
((screenChildComponent == _controller.visibleViewController .view && _presentedModals.count < 2 ) ||
1134
1130
screenChildComponent == [_presentedModals.lastObject view ])) {
1131
+ [self takeSnapshot ];
1135
1132
[screenChildComponent.controller setViewToSnapshot: _snapshot];
1136
1133
}
1137
1134
@@ -1166,18 +1163,6 @@ - (void)takeSnapshot
1166
1163
}
1167
1164
}
1168
1165
1169
- - (void )mountingTransactionWillMount : (react::MountingTransaction const &)transaction
1170
- withSurfaceTelemetry : (react::SurfaceTelemetry const &)surfaceTelemetry
1171
- {
1172
- for (auto &mutation : transaction.getMutations ()) {
1173
- if (mutation.type == react::ShadowViewMutation::Type::Remove && mutation.parentShadowView .componentName != nil &&
1174
- strcmp (mutation.parentShadowView .componentName , " RNSScreenStack" ) == 0 ) {
1175
- [self takeSnapshot ];
1176
- return ;
1177
- }
1178
- }
1179
- }
1180
-
1181
1166
- (void )prepareForRecycle
1182
1167
{
1183
1168
[super prepareForRecycle ];
0 commit comments