* In persistent mode, return whether this update needs to clone the subtree.
(current: null | Fiber, completedWork: Fiber)
| 212 | * In persistent mode, return whether this update needs to clone the subtree. |
| 213 | */ |
| 214 | function doesRequireClone(current: null | Fiber, completedWork: Fiber) { |
| 215 | const didBailout = current !== null && current.child === completedWork.child; |
| 216 | if (didBailout) { |
| 217 | return false; |
| 218 | } |
| 219 | |
| 220 | if ((completedWork.flags & ChildDeletion) !== NoFlags) { |
| 221 | return true; |
| 222 | } |
| 223 | |
| 224 | // TODO: If we move the `doesRequireClone` call after `bubbleProperties` |
| 225 | // then we only have to check the `completedWork.subtreeFlags`. |
| 226 | let child = completedWork.child; |
| 227 | while (child !== null) { |
| 228 | const checkedFlags = Cloned | Visibility | Placement | ChildDeletion; |
| 229 | if ( |
| 230 | (child.flags & checkedFlags) !== NoFlags || |
| 231 | (child.subtreeFlags & checkedFlags) !== NoFlags |
| 232 | ) { |
| 233 | return true; |
| 234 | } |
| 235 | child = child.sibling; |
| 236 | } |
| 237 | return false; |
| 238 | } |
| 239 | |
| 240 | function appendAllChildren( |
| 241 | parent: Instance, |
no outgoing calls
no test coverage detected