MCPcopy Create free account
hub / github.com/microsoft/SandDance / updateElement

Function updateElement

docs/external/js/react-dom.development.js:13696–13719  ·  view source on GitHub ↗
(returnFiber, current, element, expirationTime)

Source from the content-addressed store, hash-verified

13694 }
13695
13696 function updateElement(returnFiber, current, element, expirationTime) {
13697 if (current !== null) {
13698 if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
13699 isCompatibleFamilyForHotReloading(current, element) )) {
13700 // Move based on index
13701 var existing = useFiber(current, element.props);
13702 existing.ref = coerceRef(returnFiber, current, element);
13703 existing.return = returnFiber;
13704
13705 {
13706 existing._debugSource = element._source;
13707 existing._debugOwner = element._owner;
13708 }
13709
13710 return existing;
13711 }
13712 } // Insert
13713
13714
13715 var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
13716 created.ref = coerceRef(returnFiber, current, element);
13717 created.return = returnFiber;
13718 return created;
13719 }
13720
13721 function updatePortal(returnFiber, current, portal, expirationTime) {
13722 if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {

Callers 2

updateSlotFunction · 0.85
updateFromMapFunction · 0.85

Calls 4

useFiberFunction · 0.85
coerceRefFunction · 0.85
createFiberFromElementFunction · 0.85

Tested by

no test coverage detected