(
currentFirstChild: Fiber,
)
| 461 | } |
| 462 | |
| 463 | function mapRemainingChildren( |
| 464 | currentFirstChild: Fiber, |
| 465 | ): Map<string | number, Fiber> { |
| 466 | // Add the remaining children to a temporary map so that we can find them by |
| 467 | // keys quickly. Implicit (null) keys get added to this set with their index |
| 468 | // instead. |
| 469 | const existingChildren: Map<string | number, Fiber> = new Map(); |
| 470 | |
| 471 | let existingChild: null | Fiber = currentFirstChild; |
| 472 | while (existingChild !== null) { |
| 473 | if (existingChild.key !== null) { |
| 474 | existingChildren.set(existingChild.key, existingChild); |
| 475 | } else { |
| 476 | existingChildren.set(existingChild.index, existingChild); |
| 477 | } |
| 478 | existingChild = existingChild.sibling; |
| 479 | } |
| 480 | return existingChildren; |
| 481 | } |
| 482 | |
| 483 | function useFiber(fiber: Fiber, pendingProps: mixed): Fiber { |
| 484 | // We currently set sibling to null and index to 0 here because it is easy |
no test coverage detected