MCPcopy Create free account
hub / github.com/reactjs/react-rails / mapRemainingChildren

Function mapRemainingChildren

lib/assets/react-source/development/react.js:17175–17193  ·  view source on GitHub ↗
(returnFiber, currentFirstChild)

Source from the content-addressed store, hash-verified

17173 }
17174
17175 function mapRemainingChildren(returnFiber, currentFirstChild) {
17176 // Add the remaining children to a temporary map so that we can find them by
17177 // keys quickly. Implicit (null) keys get added to this set with their index
17178 // instead.
17179 var existingChildren = new Map();
17180 var existingChild = currentFirstChild;
17181
17182 while (existingChild !== null) {
17183 if (existingChild.key !== null) {
17184 existingChildren.set(existingChild.key, existingChild);
17185 } else {
17186 existingChildren.set(existingChild.index, existingChild);
17187 }
17188
17189 existingChild = existingChild.sibling;
17190 }
17191
17192 return existingChildren;
17193 }
17194
17195 function useFiber(fiber, pendingProps) {
17196 // We currently set sibling to null and index to 0 here because it is easy

Callers 2

reconcileChildrenArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected