MCPcopy Create free account
hub / github.com/reactjs/react-rails / updateElement

Function updateElement

lib/assets/react-source/development/react.js:17256–17279  ·  view source on GitHub ↗
(returnFiber, current, element, expirationTime)

Source from the content-addressed store, hash-verified

17254 }
17255
17256 function updateElement(returnFiber, current, element, expirationTime) {
17257 if (current !== null) {
17258 if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
17259 isCompatibleFamilyForHotReloading(current, element) )) {
17260 // Move based on index
17261 var existing = useFiber(current, element.props);
17262 existing.ref = coerceRef(returnFiber, current, element);
17263 existing.return = returnFiber;
17264
17265 {
17266 existing._debugSource = element._source;
17267 existing._debugOwner = element._owner;
17268 }
17269
17270 return existing;
17271 }
17272 } // Insert
17273
17274
17275 var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
17276 created.ref = coerceRef(returnFiber, current, element);
17277 created.return = returnFiber;
17278 return created;
17279 }
17280
17281 function updatePortal(returnFiber, current, portal, expirationTime) {
17282 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