diff --git a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h index 2e2ee37fd..11b82b32f 100644 --- a/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h +++ b/ReactCommon/fabric/core/componentdescriptor/ConcreteComponentDescriptor.h @@ -81,6 +81,7 @@ private: ShadowNodeCloneFunction getCloneFunction() const { if (!cloneFunction_) { cloneFunction_ = [this](const SharedShadowNode &shadowNode, const SharedProps &props, const SharedShadowNodeSharedList &children) { + assert(std::dynamic_pointer_cast(shadowNode)); return this->cloneShadowNode(shadowNode, props, children); }; } diff --git a/ReactCommon/fabric/uimanager/FabricUIManager.cpp b/ReactCommon/fabric/uimanager/FabricUIManager.cpp index dc73808f4..3b8786b29 100644 --- a/ReactCommon/fabric/uimanager/FabricUIManager.cpp +++ b/ReactCommon/fabric/uimanager/FabricUIManager.cpp @@ -151,7 +151,8 @@ void FabricUIManager::appendChild(const SharedShadowNode &parentShadowNode, cons // TODO: Remove this after we move this to JS side. if (childShadowNode->getSealed()) { - auto clonedChildShadowNode = componentDescriptor->cloneShadowNode(childShadowNode); + auto childComponentDescriptor = (*componentDescriptorRegistry_)[childShadowNode]; + auto clonedChildShadowNode = childComponentDescriptor->cloneShadowNode(childShadowNode); auto nonConstClonedChildShadowNode = std::const_pointer_cast(clonedChildShadowNode); nonConstClonedChildShadowNode->shallowSourceNode(); componentDescriptor->appendChild(parentShadowNode, clonedChildShadowNode);