From ff47b0eecdbcf7dae4887e5fb8558532c404be25 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Wed, 14 Apr 2021 10:33:15 -0700 Subject: [PATCH] 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 --- React/Fabric/Mounting/UIView+ComponentViewProtocol.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm index 939faead8dc..08b6603dfe7 100644 --- a/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +++ b/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm @@ -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]; }