react-native/packages
Jakub Piasecki a88ddcecc9 Fix for nodes with display: contents not being cleaned in some cases (#47194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47194

Fixes a case where a node with `display: contents` would not be cleaned up in some cases. This was caused by it being called after some early returns handling different quick paths. This PR moves the call to `cleanupContentsNodesRecursively` earlier so that it's always called.

The problem here wasn't mutating before cloning, but leaving a node marked as dirty after the layout has finished.

The exact case in which I found this was a node with a single `display: contents` child which needs to be a leaf. Then in the parent node [this](b0b842d5e7/yoga/algorithm/CalculateLayout.cpp (L1339)) condition is true, so `cleanupContentsNodesRecursively` doesn't get called and the child node is never visited and cleaned. I assume the same will happen in the other paths with an early return here.

Changelog:
[General][Fixed] - Fix for nodes with `display: contents` not being cleaned in some cases

X-link: https://github.com/facebook/yoga/pull/1729

Reviewed By: rozele

Differential Revision: D64910099

Pulled By: NickGerleman

fbshipit-source-id: 6d56f8fbf687b7ee5af889c0b868406213c9cee8
2024-10-25 17:34:36 -07:00
..
assets replace '$TEMPORARY$string<>' with 'string' (#46876) 2024-10-07 19:18:14 -07:00
babel-plugin-codegen RN: Fix lint/sort-imports Errors (#47109) 2024-10-18 04:07:02 -07:00
community-cli-plugin Update Metro to 0.81.0 (#47012) 2024-10-14 10:08:36 -07:00
core-cli-utils Bump main to 0.77 2024-09-12 09:23:23 -07:00
debugger-frontend Update debugger-frontend from 117c96a...ff343d8 (#47178) 2024-10-23 11:31:12 -07:00
dev-middleware Drop appId from /open-debugger calls, disable matching for modern targets (#47120) 2024-10-18 11:02:51 -07:00
eslint-config-react-native Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
eslint-plugin-react-native Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
eslint-plugin-specs Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
gradle-plugin AGP to 8.7.1 (#47022) 2024-10-15 06:08:09 -07:00
helloworld Bump NDK to 27.1 (#46357) 2024-10-24 10:58:09 -07:00
hermes-inspector-msggen Bump main to 0.77 2024-09-12 09:23:23 -07:00
metro-config RN: Fix lint/sort-imports Errors (#47109) 2024-10-18 04:07:02 -07:00
normalize-color Bump main to 0.77 2024-09-12 09:23:23 -07:00
polyfills Bump main to 0.77 2024-09-12 09:23:23 -07:00
react-native Fix for nodes with display: contents not being cleaned in some cases (#47194) 2024-10-25 17:34:36 -07:00
react-native-babel-preset Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
react-native-babel-transformer Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
react-native-bots fix: mitigate DangerJS transpilation bug (#47192) 2024-10-24 20:07:20 -07:00
react-native-codegen Support new codegen schema for native modules (#47114) 2024-10-21 16:43:49 -07:00
react-native-codegen-typescript-test Bump main to 0.77 2024-09-12 09:23:23 -07:00
react-native-info Bump main to 0.77 2024-09-12 09:23:23 -07:00
react-native-popup-menu-android Breaking: Remove BaseViewManagerInterface (#46809) 2024-10-09 14:49:01 -07:00
react-native-test-library Bump Kotlin 1.9.x to 2.0.x (#46955) 2024-10-11 05:34:02 -07:00
react-native-test-renderer Refactor Performance and PerformanceObserver internals (#46693) 2024-10-02 03:13:24 -07:00
rn-tester bump Folly to 2024.10.14.00 (#47033) 2024-10-24 10:10:19 -07:00
typescript-config Bump main to 0.77 2024-09-12 09:23:23 -07:00
virtualized-lists Add as const cast and make types readonly to prepare for natural inference (#47184) 2024-10-23 23:32:37 -07:00