Fabric: Fixed lost YogaNode's context in YogaLayoutableShadowNode

Summary: We replace yogaNode with newly creaded (by Yoga) one. So, we have to set up context.

Reviewed By: mdvacca

Differential Revision: D7376345

fbshipit-source-id: 7926a10e3f057fc385e7731c354827aeb8245760
This commit is contained in:
Valentin Shergin 2018-03-25 22:43:30 -07:00 committed by Facebook Github Bot
parent 1bb6db36be
commit 8f9212b839
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,6 @@ SharedYogaConfig YogaLayoutableShadowNode::suitableYogaConfig() {
return sharedYogaConfig;
}
YogaLayoutableShadowNode::YogaLayoutableShadowNode(
const SharedYogaStylableProps &props,
const SharedShadowNodeSharedList &children
@ -198,6 +197,7 @@ void YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(YGNode *oldYogaNod
assert(newShadowNode);
// And finally, we have to replace underline yoga node with the new one provided by Yoga.
newYogaNode->setContext((void *)newShadowNode.get());
newShadowNode->yogaNode_ = std::shared_ptr<YGNode>(newYogaNode);
}