mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Fabric: Fixed YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector
Summary: YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector recently was disabled because of change in Yoga (D7339832). This diff brings is back. Reviewed By: mdvacca Differential Revision: D7526417 fbshipit-source-id: 5369d641bf1e118132cf742d2d243bf426c0ffdb
This commit is contained in:
parent
3093df6754
commit
05f41931e2
@ -23,9 +23,8 @@ SharedYogaConfig YogaLayoutableShadowNode::suitableYogaConfig() {
|
||||
static SharedYogaConfig sharedYogaConfig;
|
||||
|
||||
if (!sharedYogaConfig) {
|
||||
sharedYogaConfig = std::make_shared<YGConfig>(YGConfig({
|
||||
// .cloneNodeCallback = YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector
|
||||
}));
|
||||
sharedYogaConfig = std::shared_ptr<YGConfig>(YGConfigNew());
|
||||
sharedYogaConfig->cloneNodeCallback = YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector;
|
||||
}
|
||||
|
||||
return sharedYogaConfig;
|
||||
@ -169,7 +168,7 @@ SharedDebugStringConvertibleList YogaLayoutableShadowNode::getDebugProps() const
|
||||
|
||||
#pragma mark - Yoga Connectors
|
||||
|
||||
void YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(YGNode *oldYogaNode, YGNode *newYogaNode, YGNode *parentYogaNode, int childIndex) {
|
||||
YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(YGNode *oldYogaNode, YGNode *parentYogaNode, int childIndex) {
|
||||
// We have only raw pointer to the parent shadow node, but that's enough for now.
|
||||
YogaLayoutableShadowNode *parentShadowNodeRawPtr = (YogaLayoutableShadowNode *)parentYogaNode->getContext();
|
||||
assert(parentShadowNodeRawPtr);
|
||||
@ -198,9 +197,7 @@ void YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(YGNode *oldYogaNod
|
||||
std::dynamic_pointer_cast<const YogaLayoutableShadowNode>(parentShadowNodeRawPtr->cloneAndReplaceChild(oldShadowNode));
|
||||
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);
|
||||
return newShadowNode->yogaNode_.get();
|
||||
}
|
||||
|
||||
void YogaLayoutableShadowNode::setYogaNodeChildrenBasedOnShadowNodeChildren(YGNode &yogaNode, const SharedShadowNodeSharedList &children) {
|
||||
|
@ -85,7 +85,7 @@ private:
|
||||
|
||||
static SharedYogaConfig suitableYogaConfig();
|
||||
static void setYogaNodeChildrenBasedOnShadowNodeChildren(YGNode &yogaNode, const SharedShadowNodeSharedList &children);
|
||||
static void yogaNodeCloneCallbackConnector(YGNode *oldYogaNode, YGNode *newYogaNode, YGNode *parentYogaNode, int childIndex);
|
||||
static YGNode *yogaNodeCloneCallbackConnector(YGNode *oldYogaNode, YGNode *parentYogaNode, int childIndex);
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
Loading…
x
Reference in New Issue
Block a user