Skip to content

Commit c9c2b29

Browse files
committed
Delay
1 parent c37ab2b commit c9c2b29

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

ios/RNSScreen.mm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,15 @@ - (BOOL)isTransparentModal
938938

939939
- (void)invalidateImpl
940940
{
941-
_controller = nil;
942-
[_sheetsScrollView removeObserver:self forKeyPath:@"bounds" context:nil];
941+
// We want to run after container updates are performed (transitions etc.)
942+
__weak auto weakSelf = self;
943+
dispatch_async(dispatch_get_main_queue(), ^{
944+
auto strongSelf = weakSelf;
945+
if (strongSelf) {
946+
strongSelf->_controller = nil;
947+
[strongSelf->_sheetsScrollView removeObserver:self forKeyPath:@"bounds" context:nil];
948+
}
949+
});
943950
}
944951

945952
#ifndef RCT_NEW_ARCH_ENABLED

ios/RNSScreenStack.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ - (void)mountingTransactionDidMount:(const facebook::react::MountingTransaction
14261426
#ifdef RCT_NEW_ARCH_ENABLED
14271427
[screenRef invalidateImpl];
14281428
#else
1429-
[screenRef invalidate];
1429+
[screenRef invalidate];
14301430
#endif
14311431
}
14321432
strongSelf->_toBeDeletedScreens.clear();

0 commit comments

Comments
 (0)