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

Function updateElement

code/one-direction-data-flow/public/app.js:8896–8914  ·  view source on GitHub ↗
(returnFiber, current, element, expirationTime)

Source from the content-addressed store, hash-verified

8894 }
8895
8896 function updateElement(returnFiber, current, element, expirationTime) {
8897 if (current !== null && current.type === element.type) {
8898 // Move based on index
8899 var existing = useFiber(current, element.props, expirationTime);
8900 existing.ref = coerceRef(returnFiber, current, element);
8901 existing['return'] = returnFiber;
8902 {
8903 existing._debugSource = element._source;
8904 existing._debugOwner = element._owner;
8905 }
8906 return existing;
8907 } else {
8908 // Insert
8909 var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
8910 created.ref = coerceRef(returnFiber, current, element);
8911 created['return'] = returnFiber;
8912 return created;
8913 }
8914 }
8915
8916 function updatePortal(returnFiber, current, portal, expirationTime) {
8917 if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {

Callers 2

updateSlotFunction · 0.70
updateFromMapFunction · 0.70

Calls 3

useFiberFunction · 0.70
coerceRefFunction · 0.70
createFiberFromElementFunction · 0.70

Tested by

no test coverage detected