MCPcopy Index your code
hub / github.com/microsoft/SandDance / updateHostComponent

Function updateHostComponent

docs/external/js/react-dom.development.js:17400–17439  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

17398 }
17399
17400 function updateHostComponent(current, workInProgress, renderExpirationTime) {
17401 pushHostContext(workInProgress);
17402
17403 if (current === null) {
17404 tryToClaimNextHydratableInstance(workInProgress);
17405 }
17406
17407 var type = workInProgress.type;
17408 var nextProps = workInProgress.pendingProps;
17409 var prevProps = current !== null ? current.memoizedProps : null;
17410 var nextChildren = nextProps.children;
17411 var isDirectTextChild = shouldSetTextContent(type, nextProps);
17412
17413 if (isDirectTextChild) {
17414 // We special case a direct text child of a host node. This is a common
17415 // case. We won't handle it as a reified child. We will instead handle
17416 // this in the host environment that also has access to this prop. That
17417 // avoids allocating another HostText fiber and traversing it.
17418 nextChildren = null;
17419 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
17420 // If we're switching from a direct text child to a normal child, or to
17421 // empty, we need to schedule the text content to be reset.
17422 workInProgress.effectTag |= ContentReset;
17423 }
17424
17425 markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden.
17426
17427 if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
17428 {
17429 markSpawnedWork(Never);
17430 } // Schedule this fiber to re-render at offscreen priority. Then bailout.
17431
17432
17433 workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
17434 return null;
17435 }
17436
17437 reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
17438 return workInProgress.child;
17439 }
17440
17441 function updateHostText(current, workInProgress) {
17442 if (current === null) {

Callers 1

beginWorkFunction · 0.85

Calls 7

pushHostContextFunction · 0.85
shouldSetTextContentFunction · 0.85
markRefFunction · 0.85
markSpawnedWorkFunction · 0.85
reconcileChildrenFunction · 0.85

Tested by

no test coverage detected