Skip to content

Commit 2eac5a6

Browse files
committed
Delay
1 parent d2ded8f commit 2eac5a6

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
@@ -1420,7 +1420,7 @@ - (void)mountingTransactionDidMount:(const facebook::react::MountingTransaction
14201420
#ifdef RCT_NEW_ARCH_ENABLED
14211421
[screenRef invalidateImpl];
14221422
#else
1423-
[screenRef invalidate];
1423+
[screenRef invalidate];
14241424
#endif
14251425
}
14261426
strongSelf->_toBeDeletedScreens.clear();

0 commit comments

Comments
 (0)