MCPcopy Create free account
hub / github.com/plotly/dash / updateHostComponent

Function updateHostComponent

dash/deps/react-dom@18.3.1.js:19937–19965  ·  view source on GitHub ↗
(current, workInProgress, renderLanes)

Source from the content-addressed store, hash-verified

19935 }
19936
19937 function updateHostComponent(current, workInProgress, renderLanes) {
19938 pushHostContext(workInProgress);
19939
19940 if (current === null) {
19941 tryToClaimNextHydratableInstance(workInProgress);
19942 }
19943
19944 var type = workInProgress.type;
19945 var nextProps = workInProgress.pendingProps;
19946 var prevProps = current !== null ? current.memoizedProps : null;
19947 var nextChildren = nextProps.children;
19948 var isDirectTextChild = shouldSetTextContent(type, nextProps);
19949
19950 if (isDirectTextChild) {
19951 // We special case a direct text child of a host node. This is a common
19952 // case. We won't handle it as a reified child. We will instead handle
19953 // this in the host environment that also has access to this prop. That
19954 // avoids allocating another HostText fiber and traversing it.
19955 nextChildren = null;
19956 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
19957 // If we're switching from a direct text child to a normal child, or to
19958 // empty, we need to schedule the text content to be reset.
19959 workInProgress.flags |= ContentReset;
19960 }
19961
19962 markRef(current, workInProgress);
19963 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
19964 return workInProgress.child;
19965 }
19966
19967 function updateHostText(current, workInProgress) {
19968 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…