Skip to content

fix: yoga crash with display:none#1976

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D108796888
Open

fix: yoga crash with display:none#1976
javache wants to merge 1 commit into
react:mainfrom
javache:export-D108796888

Conversation

@javache

@javache javache commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary:
It fixes this issue: react/react-native#52349
Basically, in some rare cases, having an element with display:none style caused the app to crash.

It was caused by a stale hasNewLayout flag on the hidden view
That flag was always set in computeFlexBasisForChildren for elements with display:none style, but could be never consumed/reset, because of a cache hit or something.
Since such elements contribute nothing to the layout sizes, I made the change to actually touch them only during actual layout passes

Changelog:

[GENERAL] [FIXED] - Crash: YogaLayoutableShadowNode.cpp: function layout: assertion failed (YGNodeGetOwner(childYogaNode) == &yogaNode_) react/react-native#52349

X-link: react/react-native#57197

Reviewed By: christophpurrer

Differential Revision: D108796888

Pulled By: javache

Summary:
It fixes this issue: react/react-native#52349
Basically, in some rare cases, having an element with `display:none` style caused the app to crash.

It was caused by a stale `hasNewLayout` flag on the hidden view
That flag was always set in `computeFlexBasisForChildren` for elements with `display:none` style, but could be never consumed/reset, because of a cache hit or something.
Since such elements contribute nothing to the layout sizes, I made the change to actually touch them only during actual layout passes

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Crash: YogaLayoutableShadowNode.cpp: function layout: assertion failed (YGNodeGetOwner(childYogaNode) == &yogaNode_) react/react-native#52349

X-link: react/react-native#57197

Reviewed By: christophpurrer

Differential Revision: D108796888

Pulled By: javache
@meta-cla meta-cla Bot added the CLA Signed label Jun 16, 2026
@meta-codesync

meta-codesync Bot commented Jun 16, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108796888.

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