Commit 9d910a5
Skip initial yogaLayoutableChildren_ build when fragment.children is set (#57020)
Summary:
Pull Request resolved: #57020
On the `fragment.children` path, the clone constructor used to
iterate every child with `dynamic_pointer_cast` only to have
`updateYogaChildren()` clear and rebuild the same vector a few
lines later. Drop the initial loop — `updateYogaChildren()` is the
single source of truth on this path.
`updateYogaChildrenOwnersIfNeeded()` runs in between but iterates
`yogaNode_.getChildren()` (inherited from the source's Yoga node
copy) rather than `yogaLayoutableChildren_`, so leaving the vector
empty here is safe.
Changelog:
[Internal]
Reviewed By: lenaic, christophpurrer
Differential Revision: D107076026
fbshipit-source-id: d5e056492e7248608ca50717aed3d20822839f251 parent 4bf3477 commit 9d910a5
1 file changed
Lines changed: 9 additions & 16 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/components/view
Lines changed: 9 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
132 | 125 | | |
133 | 126 | | |
134 | 127 | | |
| |||
0 commit comments