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

Function finishClassComponent

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

Source from the content-addressed store, hash-verified

19723 }
19724
19725 function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {
19726 // Refs should update even if shouldComponentUpdate returns false
19727 markRef(current, workInProgress);
19728 var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;
19729
19730 if (!shouldUpdate && !didCaptureError) {
19731 // Context providers should defer to sCU for rendering
19732 if (hasContext) {
19733 invalidateContextProvider(workInProgress, Component, false);
19734 }
19735
19736 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
19737 }
19738
19739 var instance = workInProgress.stateNode; // Rerender
19740
19741 ReactCurrentOwner$1.current = workInProgress;
19742 var nextChildren;
19743
19744 if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
19745 // If we captured an error, but getDerivedStateFromError is not defined,
19746 // unmount all the children. componentDidCatch will schedule an update to
19747 // re-render a fallback. This is temporary until we migrate everyone to
19748 // the new API.
19749 // TODO: Warn in a future release.
19750 nextChildren = null;
19751
19752 {
19753 stopProfilerTimerIfRunning();
19754 }
19755 } else {
19756 {
19757 markComponentRenderStarted(workInProgress);
19758 }
19759
19760 {
19761 setIsRendering(true);
19762 nextChildren = instance.render();
19763
19764 if ( workInProgress.mode & StrictLegacyMode) {
19765 setIsStrictModeForDevtools(true);
19766
19767 try {
19768 instance.render();
19769 } finally {
19770 setIsStrictModeForDevtools(false);
19771 }
19772 }
19773
19774 setIsRendering(false);
19775 }
19776
19777 {
19778 markComponentRenderStopped();
19779 }
19780 } // React DevTools reads this flag.
19781
19782

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…