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

Function finishClassComponent

bundle.js:7377–7384  ·  view source on GitHub ↗
(current,workInProgress,shouldUpdate,hasContext)

Source from the content-addressed store, hash-verified

7375constructClassInstance(workInProgress,workInProgress.pendingProps);mountClassInstance(workInProgress,priorityLevel);shouldUpdate=true;}else{invariant(false,'Resuming work not yet implemented.');// In a resume, we'll already have an instance we can reuse.
7376// shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel);
7377}}else{shouldUpdate=updateClassInstance(current,workInProgress,priorityLevel);}return finishClassComponent(current,workInProgress,shouldUpdate,hasContext);}function finishClassComponent(current,workInProgress,shouldUpdate,hasContext){// Refs should update even if shouldComponentUpdate returns false
7378markRef(current,workInProgress);if(!shouldUpdate){// Context providers should defer to sCU for rendering
7379if(hasContext){invalidateContextProvider$1(workInProgress,false);}return bailoutOnAlreadyFinishedWork(current,workInProgress);}var instance=workInProgress.stateNode;// Rerender
7380ReactCurrentOwner$2.current=workInProgress;var nextChildren=void 0;{ReactDebugCurrentFiber$4.setCurrentFiber(workInProgress,'render');nextChildren=instance.render();ReactDebugCurrentFiber$4.setCurrentFiber(workInProgress,null);}// React DevTools reads this flag.
7381workInProgress.effectTag|=PerformedWork$1;reconcileChildren(current,workInProgress,nextChildren);// Memoize props and state using the values we just used to render.
7382// TODO: Restructure so we never read values from the instance.
7383memoizeState(workInProgress,instance.state);memoizeProps(workInProgress,instance.props);// The context might have changed so we need to recalculate it.
7384if(hasContext){invalidateContextProvider$1(workInProgress,true);}return workInProgress.child;}function pushHostRootContext(workInProgress){var root=workInProgress.stateNode;if(root.pendingContext){pushTopLevelContextObject$1(workInProgress,root.pendingContext,root.pendingContext!==root.context);}else if(root.context){// Should always be set
7385pushTopLevelContextObject$1(workInProgress,root.context,false);}pushHostContainer(workInProgress,root.containerInfo);}function updateHostRoot(current,workInProgress,priorityLevel){pushHostRootContext(workInProgress);var updateQueue=workInProgress.updateQueue;if(updateQueue!==null){var prevState=workInProgress.memoizedState;var state=beginUpdateQueue$1(current,workInProgress,updateQueue,null,prevState,null,priorityLevel);if(prevState===state){// If the state is the same as before, that's a bailout because we had
7386// no work matching this priority.
7387resetHydrationState();return bailoutOnAlreadyFinishedWork(current,workInProgress);}var element=state.element;if((current===null||current.child===null)&&enterHydrationState(workInProgress)){// If we don't have any current children this might be the first pass.

Callers 2

updateClassComponentFunction · 0.85

Calls 6

markRefFunction · 0.85
reconcileChildrenFunction · 0.85
memoizeStateFunction · 0.85
memoizePropsFunction · 0.85
renderMethod · 0.45

Tested by

no test coverage detected