From 39cb02f6f168d95b7a0459e54311bda254d28b83 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 29 Jan 2024 12:30:12 -0800 Subject: [PATCH] explicitly dirty yoga node when cloned in case parent is dirty (#42711) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42711 changelog: [internal] Reviewed By: NickGerleman Differential Revision: D53130776 fbshipit-source-id: b85a90835698ef5199622edcb64f64273d32724a --- .../react/renderer/components/text/ParagraphShadowNode.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp index fa48189076ebfe..85929d367d2d88 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp @@ -30,7 +30,10 @@ ParagraphShadowNode::ParagraphShadowNode( const ShadowNode& sourceShadowNode, const ShadowNodeFragment& fragment) : ConcreteViewShadowNode(sourceShadowNode, fragment) { - if (!fragment.children && !fragment.props) { + auto& sourceParagraphShadowNode = + traitCast(sourceShadowNode); + if (!fragment.children && !fragment.props && + sourceParagraphShadowNode.getIsLayoutClean()) { // This ParagraphShadowNode was cloned but did not change // in a way that affects its layout. Let's mark it clean // to stop Yoga from traversing it.