MCPcopy
hub / github.com/plotly/dash / updateHostComponent

Function updateHostComponent

dash/deps/react-dom@18.2.0.js:19908–19936  ·  view source on GitHub ↗
(current, workInProgress, renderLanes)

Source from the content-addressed store, hash-verified

19906 }
19907
19908 function updateHostComponent(current, workInProgress, renderLanes) {
19909 pushHostContext(workInProgress);
19910
19911 if (current === null) {
19912 tryToClaimNextHydratableInstance(workInProgress);
19913 }
19914
19915 var type = workInProgress.type;
19916 var nextProps = workInProgress.pendingProps;
19917 var prevProps = current !== null ? current.memoizedProps : null;
19918 var nextChildren = nextProps.children;
19919 var isDirectTextChild = shouldSetTextContent(type, nextProps);
19920
19921 if (isDirectTextChild) {
19922 // We special case a direct text child of a host node. This is a common
19923 // case. We won't handle it as a reified child. We will instead handle
19924 // this in the host environment that also has access to this prop. That
19925 // avoids allocating another HostText fiber and traversing it.
19926 nextChildren = null;
19927 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
19928 // If we're switching from a direct text child to a normal child, or to
19929 // empty, we need to schedule the text content to be reset.
19930 workInProgress.flags |= ContentReset;
19931 }
19932
19933 markRef(current, workInProgress);
19934 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
19935 return workInProgress.child;
19936 }
19937
19938 function updateHostText(current, workInProgress) {
19939 if (current === null) {

Callers 1

beginWorkFunction · 0.70

Calls 5

pushHostContextFunction · 0.70
shouldSetTextContentFunction · 0.70
markRefFunction · 0.70
reconcileChildrenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…