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

Function reconcileSingleElement

code/composition/public/app.js:9691–9728  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, element, expirationTime)

Source from the content-addressed store, hash-verified

9689 }
9690
9691 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
9692 var key = element.key;
9693 var child = currentFirstChild;
9694 while (child !== null) {
9695 // TODO: If key === null and child.key === null, then this only applies to
9696 // the first item in the list.
9697 if (child.key === key) {
9698 if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) {
9699 deleteRemainingChildren(returnFiber, child.sibling);
9700 var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
9701 existing.ref = coerceRef(returnFiber, child, element);
9702 existing['return'] = returnFiber;
9703 {
9704 existing._debugSource = element._source;
9705 existing._debugOwner = element._owner;
9706 }
9707 return existing;
9708 } else {
9709 deleteRemainingChildren(returnFiber, child);
9710 break;
9711 }
9712 } else {
9713 deleteChild(returnFiber, child);
9714 }
9715 child = child.sibling;
9716 }
9717
9718 if (element.type === REACT_FRAGMENT_TYPE) {
9719 var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
9720 created['return'] = returnFiber;
9721 return created;
9722 } else {
9723 var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
9724 _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
9725 _created4['return'] = returnFiber;
9726 return _created4;
9727 }
9728 }
9729
9730 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
9731 var key = portal.key;

Callers 1

reconcileChildFibersFunction · 0.70

Calls 6

deleteRemainingChildrenFunction · 0.70
useFiberFunction · 0.70
coerceRefFunction · 0.70
deleteChildFunction · 0.70
createFiberFromFragmentFunction · 0.70
createFiberFromElementFunction · 0.70

Tested by

no test coverage detected