( current: Fiber | null, workInProgress: Fiber, nextChildren: any, renderLanes: Lanes, )
| 339 | } |
| 340 | |
| 341 | export function reconcileChildren( |
| 342 | current: Fiber | null, |
| 343 | workInProgress: Fiber, |
| 344 | nextChildren: any, |
| 345 | renderLanes: Lanes, |
| 346 | ) { |
| 347 | if (current === null) { |
| 348 | // If this is a fresh new component that hasn't been rendered yet, we |
| 349 | // won't update its child set by applying minimal side-effects. Instead, |
| 350 | // we will add them all to the child before it gets rendered. That means |
| 351 | // we can optimize this reconciliation pass by not tracking side-effects. |
| 352 | workInProgress.child = mountChildFibers( |
| 353 | workInProgress, |
| 354 | null, |
| 355 | nextChildren, |
| 356 | renderLanes, |
| 357 | ); |
| 358 | } else { |
| 359 | // If the current child is the same as the work in progress, it means that |
| 360 | // we haven't yet started any work on these children. Therefore, we use |
| 361 | // the clone algorithm to create a copy of all the current children. |
| 362 | |
| 363 | // If we had any progressed work already, that is invalid at this point so |
| 364 | // let's throw it out. |
| 365 | workInProgress.child = reconcileChildFibers( |
| 366 | workInProgress, |
| 367 | current.child, |
| 368 | nextChildren, |
| 369 | renderLanes, |
| 370 | ); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | function forceUnmountCurrentAndReconcile( |
| 375 | current: Fiber, |
no test coverage detected