diff --git a/cpp/react/renderer/components/SLContainerSpec/SLContainerComponentDescriptor.h b/cpp/react/renderer/components/SLContainerSpec/SLContainerComponentDescriptor.h index ea7e03b..413c09e 100644 --- a/cpp/react/renderer/components/SLContainerSpec/SLContainerComponentDescriptor.h +++ b/cpp/react/renderer/components/SLContainerSpec/SLContainerComponentDescriptor.h @@ -10,13 +10,6 @@ class SLContainerComponentDescriptor : public ConcreteComponentDescriptor(shadowNode); - containerShadowNodeLayoutable.setSize({500, 500}); - ConcreteComponentDescriptor::adopt(shadowNode); } }; diff --git a/cpp/react/renderer/components/SLContainerSpec/SLContainerShadowNode.cpp b/cpp/react/renderer/components/SLContainerSpec/SLContainerShadowNode.cpp index 7276efb..d3c57d5 100644 --- a/cpp/react/renderer/components/SLContainerSpec/SLContainerShadowNode.cpp +++ b/cpp/react/renderer/components/SLContainerSpec/SLContainerShadowNode.cpp @@ -107,7 +107,10 @@ void SLContainerShadowNode::layout(LayoutContext layoutContext) { auto elementShadowNodeLayoutable = std::static_pointer_cast(elementShadowNodeComponentRegistry[elementDataUniqueKey]); if (elementShadowNodeLayoutable->getLayoutMetrics().frame.size.height == 0) { - elementShadowNodeLayoutable->layoutTree(layoutContext, {}); + LayoutConstraints layoutConstraints = {}; + layoutConstraints.minimumSize.width = getLayoutMetrics().frame.size.width; + layoutConstraints.maximumSize.width = getLayoutMetrics().frame.size.width; + elementShadowNodeLayoutable->layoutTree(layoutContext, layoutConstraints); } nextStateData.childrenMeasurementsTree[elementDataIndex] = elementShadowNodeLayoutable->getLayoutMetrics().frame.size.height; @@ -167,6 +170,7 @@ void SLContainerShadowNode::layout(LayoutContext layoutContext) { } this->children_ = containerShadowNodeChildren; + yogaNode_.setDirty(true); nextStateData.firstChildUniqueId = props.getElementValueByPath(props.data.front(), "id"); nextStateData.lastChildUniqueId = props.getElementValueByPath(props.data.back(), "id");