Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,16 @@ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompo
childComponentView,
@(index),
@([childComponentView.superview tag]));
NSArray<UIView *> *containerSubviews = self.currentContainerView.subviews;
BOOL isIndexInBounds = index >= 0 && (NSUInteger)index < containerSubviews.count;
RCTAssert(
(self.currentContainerView.subviews.count > index) &&
[self.currentContainerView.subviews objectAtIndex:index] == childComponentView,
isIndexInBounds && [containerSubviews objectAtIndex:index] == childComponentView,
@"Attempt to unmount a view which has a different index. (parent: %@, child: %@, index: %@, actual index: %@, tag at index: %@)",
self,
childComponentView,
@(index),
@([self.currentContainerView.subviews indexOfObject:childComponentView]),
@([[self.currentContainerView.subviews objectAtIndex:index] tag]));
@([containerSubviews indexOfObject:childComponentView]),
isIndexInBounds ? @([[containerSubviews objectAtIndex:index] tag]) : @"out of bounds");
}

[childComponentView removeFromSuperview];
Expand Down