MCPcopy Create free account
hub / github.com/microsoft/SandDance / mapRemainingChildren

Function mapRemainingChildren

docs/external/js/react-dom.development.js:13615–13633  ·  view source on GitHub ↗
(returnFiber, currentFirstChild)

Source from the content-addressed store, hash-verified

13613 }
13614
13615 function mapRemainingChildren(returnFiber, currentFirstChild) {
13616 // Add the remaining children to a temporary map so that we can find them by
13617 // keys quickly. Implicit (null) keys get added to this set with their index
13618 // instead.
13619 var existingChildren = new Map();
13620 var existingChild = currentFirstChild;
13621
13622 while (existingChild !== null) {
13623 if (existingChild.key !== null) {
13624 existingChildren.set(existingChild.key, existingChild);
13625 } else {
13626 existingChildren.set(existingChild.index, existingChild);
13627 }
13628
13629 existingChild = existingChild.sibling;
13630 }
13631
13632 return existingChildren;
13633 }
13634
13635 function useFiber(fiber, pendingProps) {
13636 // We currently set sibling to null and index to 0 here because it is easy

Callers 2

reconcileChildrenArrayFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected