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

Function finishClassComponent

dash/deps/react-dom@18.3.1.js:19754–19833  ·  view source on GitHub ↗
(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes)

Source from the content-addressed store, hash-verified

19752 }
19753
19754 function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {
19755 // Refs should update even if shouldComponentUpdate returns false
19756 markRef(current, workInProgress);
19757 var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;
19758
19759 if (!shouldUpdate && !didCaptureError) {
19760 // Context providers should defer to sCU for rendering
19761 if (hasContext) {
19762 invalidateContextProvider(workInProgress, Component, false);
19763 }
19764
19765 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
19766 }
19767
19768 var instance = workInProgress.stateNode; // Rerender
19769
19770 ReactCurrentOwner$1.current = workInProgress;
19771 var nextChildren;
19772
19773 if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
19774 // If we captured an error, but getDerivedStateFromError is not defined,
19775 // unmount all the children. componentDidCatch will schedule an update to
19776 // re-render a fallback. This is temporary until we migrate everyone to
19777 // the new API.
19778 // TODO: Warn in a future release.
19779 nextChildren = null;
19780
19781 {
19782 stopProfilerTimerIfRunning();
19783 }
19784 } else {
19785 {
19786 markComponentRenderStarted(workInProgress);
19787 }
19788
19789 {
19790 setIsRendering(true);
19791 nextChildren = instance.render();
19792
19793 if ( workInProgress.mode & StrictLegacyMode) {
19794 setIsStrictModeForDevtools(true);
19795
19796 try {
19797 instance.render();
19798 } finally {
19799 setIsStrictModeForDevtools(false);
19800 }
19801 }
19802
19803 setIsRendering(false);
19804 }
19805
19806 {
19807 markComponentRenderStopped();
19808 }
19809 } // React DevTools reads this flag.
19810
19811

Callers 3

updateClassComponentFunction · 0.70

Calls 11

markRefFunction · 0.70
setIsRenderingFunction · 0.70
reconcileChildrenFunction · 0.70
renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…