MCPcopy Index your code
hub / github.com/react/react / resetWorkInProgressStack

Function resetWorkInProgressStack

packages/react-reconciler/src/ReactFiberWorkLoop.js:1888–1911  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1886}
1887
1888function resetWorkInProgressStack() {
1889 if (workInProgress === null) return;
1890 let interruptedWork;
1891 if (workInProgressSuspendedReason === NotSuspended) {
1892 // Normal case. Work-in-progress hasn't started yet. Unwind all
1893 // its parents.
1894 interruptedWork = workInProgress.return;
1895 } else {
1896 // Work-in-progress is in suspended state. Reset the work loop and unwind
1897 // both the suspended fiber and all its parents.
1898 resetSuspendedWorkLoopOnUnwind(workInProgress);
1899 interruptedWork = workInProgress;
1900 }
1901 while (interruptedWork !== null) {
1902 const current = interruptedWork.alternate;
1903 unwindInterruptedWork(
1904 current,
1905 interruptedWork,
1906 workInProgressRootRenderLanes,
1907 );
1908 interruptedWork = interruptedWork.return;
1909 }
1910 workInProgress = null;
1911}
1912
1913function finalizeRender(lanes: Lanes, finalizationTime: number): void {
1914 if (enableProfilerTimer && enableComponentPerformanceTrack) {

Callers 3

prepareFreshStackFunction · 0.85
renderRootSyncFunction · 0.85
renderRootConcurrentFunction · 0.85

Calls 2

unwindInterruptedWorkFunction · 0.90

Tested by

no test coverage detected