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

Function reconcileSingleElement

code/third-party/public/app.js:8786–8823  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, element, expirationTime)

Source from the content-addressed store, hash-verified

8784 }
8785
8786 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
8787 var key = element.key;
8788 var child = currentFirstChild;
8789 while (child !== null) {
8790 // TODO: If key === null and child.key === null, then this only applies to
8791 // the first item in the list.
8792 if (child.key === key) {
8793 if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) {
8794 deleteRemainingChildren(returnFiber, child.sibling);
8795 var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
8796 existing.ref = coerceRef(returnFiber, child, element);
8797 existing['return'] = returnFiber;
8798 {
8799 existing._debugSource = element._source;
8800 existing._debugOwner = element._owner;
8801 }
8802 return existing;
8803 } else {
8804 deleteRemainingChildren(returnFiber, child);
8805 break;
8806 }
8807 } else {
8808 deleteChild(returnFiber, child);
8809 }
8810 child = child.sibling;
8811 }
8812
8813 if (element.type === REACT_FRAGMENT_TYPE) {
8814 var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
8815 created['return'] = returnFiber;
8816 return created;
8817 } else {
8818 var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
8819 _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
8820 _created4['return'] = returnFiber;
8821 return _created4;
8822 }
8823 }
8824
8825 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
8826 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