MCPcopy Index your code
hub / github.com/caseywebdev/react-list / performWorkOnRoot

Function performWorkOnRoot

docs/index.js:13788–13955  ·  view source on GitHub ↗
(root$jscomp$0, lanes, forceSync)

Source from the content-addressed store, hash-verified

13786 ensureRootIsScheduled(root);
13787}
13788function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
13789 if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
13790 var shouldTimeSlice =
13791 (!forceSync &&
13792 0 === (lanes & 60) &&
13793 0 === (lanes & root$jscomp$0.expiredLanes)) ||
13794 checkIfRootIsPrerendering(root$jscomp$0, lanes),
13795 exitStatus = shouldTimeSlice
13796 ? renderRootConcurrent(root$jscomp$0, lanes)
13797 : renderRootSync(root$jscomp$0, lanes, !0),
13798 renderWasConcurrent = shouldTimeSlice;
13799 do {
13800 if (0 === exitStatus) {
13801 workInProgressRootIsPrerendering &&
13802 !shouldTimeSlice &&
13803 markRootSuspended(root$jscomp$0, lanes, 0, !1);
13804 break;
13805 } else if (6 === exitStatus)
13806 markRootSuspended(
13807 root$jscomp$0,
13808 lanes,
13809 0,
13810 !workInProgressRootDidSkipSuspendedSiblings
13811 );
13812 else {
13813 forceSync = root$jscomp$0.current.alternate;
13814 if (
13815 renderWasConcurrent &&
13816 !isRenderConsistentWithExternalStores(forceSync)
13817 ) {
13818 exitStatus = renderRootSync(root$jscomp$0, lanes, !1);
13819 renderWasConcurrent = !1;
13820 continue;
13821 }
13822 if (2 === exitStatus) {
13823 renderWasConcurrent = lanes;
13824 if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
13825 var JSCompiler_inline_result = 0;
13826 else
13827 (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913),
13828 (JSCompiler_inline_result =
13829 0 !== JSCompiler_inline_result
13830 ? JSCompiler_inline_result
13831 : JSCompiler_inline_result & 536870912
13832 ? 536870912
13833 : 0);
13834 if (0 !== JSCompiler_inline_result) {
13835 lanes = JSCompiler_inline_result;
13836 a: {
13837 var root = root$jscomp$0;
13838 exitStatus = workInProgressRootConcurrentErrors;
13839 var wasRootDehydrated = root.current.memoizedState.isDehydrated;
13840 wasRootDehydrated &&
13841 (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256);
13842 JSCompiler_inline_result = renderRootSync(
13843 root,
13844 JSCompiler_inline_result,
13845 !1

Callers 2

performSyncWorkOnRootFunction · 0.85

Calls 12

formatProdErrorMessageFunction · 0.85
renderRootConcurrentFunction · 0.85
renderRootSyncFunction · 0.85
markRootSuspendedFunction · 0.85
prepareFreshStackFunction · 0.85
queueRecoverableErrorsFunction · 0.85
getNextLanesFunction · 0.85
commitRootWhenReadyFunction · 0.85
ensureRootIsScheduledFunction · 0.85
commitRootFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…