Skip to content

Commit 14fca34

Browse files
committed
Prevent invalidateSafeAreaInsets get call when RNCSafeAreaProviderComponentView still in the fabric view pool
1 parent 37e8765 commit 14fca34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ios/Fabric/RNCSafeAreaProviderComponentView.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ - (void)safeAreaInsetsDidChange
5757

5858
- (void)invalidateSafeAreaInsets
5959
{
60+
if (self.superview == nil) { return; }
6061
// This gets called before the view size is set by react-native so
6162
// make sure to wait so we don't set wrong insets to JS.
6263
if (CGSizeEqualToSize(self.frame.size, CGSizeZero)) {
@@ -123,6 +124,7 @@ - (void)prepareForRecycle
123124
_currentSafeAreaInsets = UIEdgeInsetsZero;
124125
_currentFrame = CGRectZero;
125126
_initialInsetsSent = NO;
127+
[NSNotificationCenter.defaultCenter removeObserver:self];
126128
}
127129

128130
@end

0 commit comments

Comments
 (0)