Skip to content

Conversation

@j-piasecki
Copy link
Contributor

This PR fixes two issues with display: contents implementation:

  1. When a node with display: contents set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
  2. It was possible for the subtree of display: contents nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: [Due for payment 2025-07-28] [$250] [DEV] - iOS HybridApp crashes when opening a workspace expense that misses category Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to react-native-onyx, which is a state management library.

@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 0:25am

@facebook-github-bot
Copy link
Contributor

@j-piasecki has imported this pull request. If you are a Meta employee, you can view this in D78084270.

j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Jul 10, 2025
Summary:
This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: facebook/yoga#1826

Reviewed By: adityasharat

Differential Revision: D78084270

Pulled By: j-piasecki
…acebook#1826)

Summary:
This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner


Reviewed By: adityasharat

Differential Revision: D78084270

Pulled By: j-piasecki
@j-piasecki j-piasecki force-pushed the @jpiasecki/contents-fix-updates branch from 0908777 to 5f4fcb1 Compare July 10, 2025 12:23
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78084270

@facebook-github-bot
Copy link
Contributor

@j-piasecki merged this pull request in c7c8562.

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Jul 11, 2025
Summary:
X-link: facebook/react-native#52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: facebook/yoga#1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Jul 11, 2025
…52530)

Summary:
Pull Request resolved: #52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: facebook/yoga#1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
motiz88 pushed a commit to facebook/react-native that referenced this pull request Jul 14, 2025
…52530)

Summary:
Pull Request resolved: #52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: facebook/yoga#1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
kikoso pushed a commit to kikoso/react-native that referenced this pull request Aug 26, 2025
…acebook#52530)

Summary:
Pull Request resolved: facebook#52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: Expensify/App#65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: facebook/yoga#1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants