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

Function reconcileSingleElement

code/redux/public/app.js:9804–9841  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, element, expirationTime)

Source from the content-addressed store, hash-verified

9802 }
9803
9804 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
9805 var key = element.key;
9806 var child = currentFirstChild;
9807 while (child !== null) {
9808 // TODO: If key === null and child.key === null, then this only applies to
9809 // the first item in the list.
9810 if (child.key === key) {
9811 if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) {
9812 deleteRemainingChildren(returnFiber, child.sibling);
9813 var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
9814 existing.ref = coerceRef(returnFiber, child, element);
9815 existing['return'] = returnFiber;
9816 {
9817 existing._debugSource = element._source;
9818 existing._debugOwner = element._owner;
9819 }
9820 return existing;
9821 } else {
9822 deleteRemainingChildren(returnFiber, child);
9823 break;
9824 }
9825 } else {
9826 deleteChild(returnFiber, child);
9827 }
9828 child = child.sibling;
9829 }
9830
9831 if (element.type === REACT_FRAGMENT_TYPE) {
9832 var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
9833 created['return'] = returnFiber;
9834 return created;
9835 } else {
9836 var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
9837 _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
9838 _created4['return'] = returnFiber;
9839 return _created4;
9840 }
9841 }
9842
9843 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
9844 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