Fabric: Using a proper Component Descriptor for node cloning

Summary: To clone a ShadowNode we must use node's ComponentDescriptot, not parent node's one.

Reviewed By: mdvacca

Differential Revision: D7738583

fbshipit-source-id: 83656f9a761530cdaedf65663ae28b3119af75f5
This commit is contained in:
Valentin Shergin
2018-04-26 17:51:41 -07:00
committed by Facebook Github Bot
parent 3428808b97
commit 6aa52f2684
2 changed files with 3 additions and 1 deletions

View File

@@ -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<const ShadowNodeT>(shadowNode));
return this->cloneShadowNode(shadowNode, props, children);
};
}