From 8f9212b83922e3adeb3dcdd20d239ebab7a1fcda Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 25 Mar 2018 22:43:30 -0700 Subject: [PATCH] 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 --- ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp index f53d63f70ee..376f092367c 100644 --- a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp @@ -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(newYogaNode); }