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
This commit is contained in:
Samuel Susla
2024-01-29 12:30:12 -08:00
committed by Facebook GitHub Bot
parent 5bf5f4b150
commit 39cb02f6f1
@@ -30,7 +30,10 @@ ParagraphShadowNode::ParagraphShadowNode(
const ShadowNode& sourceShadowNode,
const ShadowNodeFragment& fragment)
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
if (!fragment.children && !fragment.props) {
auto& sourceParagraphShadowNode =
traitCast<ParagraphShadowNode const&>(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.