MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / updateHostComponent

Function updateHostComponent

bundle.js:7401–7412  ·  view source on GitHub ↗
(current,workInProgress,renderPriority)

Source from the content-addressed store, hash-verified

7399// root.
7400resetHydrationState();reconcileChildren(current,workInProgress,element);}memoizeState(workInProgress,state);return workInProgress.child;}resetHydrationState();// If there is no update queue, that's a bailout because the root has no props.
7401return bailoutOnAlreadyFinishedWork(current,workInProgress);}function updateHostComponent(current,workInProgress,renderPriority){pushHostContext(workInProgress);if(current===null){tryToClaimNextHydratableInstance(workInProgress);}var type=workInProgress.type;var memoizedProps=workInProgress.memoizedProps;var nextProps=workInProgress.pendingProps;if(nextProps===null){nextProps=memoizedProps;!(nextProps!==null)?invariant(false,'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.'):void 0;}var prevProps=current!==null?current.memoizedProps:null;if(hasContextChanged$1()){// Normally we can bail out on props equality but if context has changed
7402// we don't do the bailout and we have to reuse existing props instead.
7403}else if(nextProps===null||memoizedProps===nextProps){return bailoutOnAlreadyFinishedWork(current,workInProgress);}var nextChildren=nextProps.children;var isDirectTextChild=shouldSetTextContent(type,nextProps);if(isDirectTextChild){// We special case a direct text child of a host node. This is a common
7404// case. We won't handle it as a reified child. We will instead handle
7405// this in the host environment that also have access to this prop. That
7406// avoids allocating another HostText fiber and traversing it.
7407nextChildren=null;}else if(prevProps&&shouldSetTextContent(type,prevProps)){// If we're switching from a direct text child to a normal child, or to
7408// empty, we need to schedule the text content to be reset.
7409workInProgress.effectTag|=ContentReset$1;}markRef(current,workInProgress);// Check the host config to see if the children are offscreen/hidden.
7410if(renderPriority!==OffscreenPriority$1&&!useSyncScheduling&&shouldDeprioritizeSubtree(type,nextProps)){// Down-prioritize the children.
7411workInProgress.pendingWorkPriority=OffscreenPriority$1;// Bailout and come back to this fiber later at OffscreenPriority.
7412return null;}reconcileChildren(current,workInProgress,nextChildren);memoizeProps(workInProgress,nextProps);return workInProgress.child;}function updateHostText(current,workInProgress){if(current===null){tryToClaimNextHydratableInstance(workInProgress);}var nextProps=workInProgress.pendingProps;if(nextProps===null){nextProps=workInProgress.memoizedProps;}memoizeProps(workInProgress,nextProps);// Nothing to do here. This is terminal. We'll do the completion step
7413// immediately after.
7414return null;}function mountIndeterminateComponent(current,workInProgress,priorityLevel){!(current===null)?invariant(false,'An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.'):void 0;var fn=workInProgress.type;var props=workInProgress.pendingProps;var unmaskedContext=getUnmaskedContext$1(workInProgress);var context=getMaskedContext$1(workInProgress,unmaskedContext);var value;{ReactCurrentOwner$2.current=workInProgress;value=fn(props,context);}// React DevTools reads this flag.
7415workInProgress.effectTag|=PerformedWork$1;if((typeof value==='undefined'?'undefined':_typeof(value))==='object'&&value!==null&&typeof value.render==='function'){// Proceed under the assumption that this is a class instance

Callers 1

beginWorkFunction · 0.85

Calls 7

pushHostContextFunction · 0.85
markRefFunction · 0.85
reconcileChildrenFunction · 0.85
memoizePropsFunction · 0.85
invariantFunction · 0.70

Tested by

no test coverage detected