Skip to content

Commit

Permalink
explicitly dirty yoga node when cloned in case parent is dirty (#42711)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #42711

changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D53130776

fbshipit-source-id: b85a90835698ef5199622edcb64f64273d32724a
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Jan 29, 2024
1 parent 5bf5f4b commit 39cb02f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 39cb02f

Please sign in to comment.