MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / mapRemainingChildren

Function mapRemainingChildren

code/new-context-api/public/app.js:8311–8326  ·  view source on GitHub ↗
(returnFiber, currentFirstChild)

Source from the content-addressed store, hash-verified

8309 }
8310
8311 function mapRemainingChildren(returnFiber, currentFirstChild) {
8312 // Add the remaining children to a temporary map so that we can find them by
8313 // keys quickly. Implicit (null) keys get added to this set with their index
8314 var existingChildren = new Map();
8315
8316 var existingChild = currentFirstChild;
8317 while (existingChild !== null) {
8318 if (existingChild.key !== null) {
8319 existingChildren.set(existingChild.key, existingChild);
8320 } else {
8321 existingChildren.set(existingChild.index, existingChild);
8322 }
8323 existingChild = existingChild.sibling;
8324 }
8325 return existingChildren;
8326 }
8327
8328 function useFiber(fiber, pendingProps, expirationTime) {
8329 // We currently set sibling to null and index to 0 here because it is easy

Callers 2

reconcileChildrenArrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected