mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Mounting: log more information in iOS-only REMOVE assert
Summary: Log a little more information in the iOS-only assert checking that the REMOVE index is correct. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D27632457 fbshipit-source-id: 56e668dc2f22841e3cf3d838ba605d63cc7c1bad
This commit is contained in:
committed by
Facebook GitHub Bot
parent
88c3090066
commit
ff47b0eecd
@@ -32,10 +32,11 @@ using namespace facebook::react;
|
||||
{
|
||||
RCTAssert(
|
||||
childComponentView.superview == nil,
|
||||
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@)",
|
||||
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@, existing parent: %@)",
|
||||
self,
|
||||
childComponentView,
|
||||
@(index));
|
||||
@(index),
|
||||
@([childComponentView.superview tag]));
|
||||
[self insertSubview:childComponentView atIndex:index];
|
||||
}
|
||||
|
||||
@@ -49,10 +50,12 @@ using namespace facebook::react;
|
||||
@(index));
|
||||
RCTAssert(
|
||||
(self.subviews.count > index) && [self.subviews objectAtIndex:index] == childComponentView,
|
||||
@"Attempt to unmount a view which has a different index. (parent: %@, child: %@, index: %@)",
|
||||
@"Attempt to unmount a view which has a different index. (parent: %@, child: %@, index: %@, actual index: %@, tag at index: %@)",
|
||||
self,
|
||||
childComponentView,
|
||||
@(index));
|
||||
@(index),
|
||||
@([self.subviews indexOfObject:childComponentView]),
|
||||
@([[self.subviews objectAtIndex:index] tag]));
|
||||
|
||||
[childComponentView removeFromSuperview];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user