diff --git a/React/Fabric/Mounting/RCTComponentViewRegistry.mm b/React/Fabric/Mounting/RCTComponentViewRegistry.mm index 635a8e1dc..81816f1ea 100644 --- a/React/Fabric/Mounting/RCTComponentViewRegistry.mm +++ b/React/Fabric/Mounting/RCTComponentViewRegistry.mm @@ -87,6 +87,10 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 256; tag:(ReactTag)tag { RCTAssertMainQueue(); + + RCTAssert(![_registry objectForKey:(__bridge id)(void *)tag], + @"RCTComponentViewRegistry: Attempt to dequeue already registered component."); + UIView *componentView = [self _dequeueComponentViewWithName:componentName]; componentView.tag = tag; @@ -105,6 +109,9 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 256; { RCTAssertMainQueue(); + RCTAssert([_registry objectForKey:(__bridge id)(void *)tag], + @"RCTComponentViewRegistry: Attempt to enqueue unregistered component."); + #ifdef LEGACY_UIMANAGER_INTEGRATION_ENABLED [RCTUIManager unregisterView:componentView]; #endif