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

Function mountSuspenseFallbackChildren

dash/deps/react-dom@18.3.1.js:20449–20488  ·  view source on GitHub ↗
(workInProgress, primaryChildren, fallbackChildren, renderLanes)

Source from the content-addressed store, hash-verified

20447 }
20448
20449 function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {
20450 var mode = workInProgress.mode;
20451 var progressedPrimaryFragment = workInProgress.child;
20452 var primaryChildProps = {
20453 mode: 'hidden',
20454 children: primaryChildren
20455 };
20456 var primaryChildFragment;
20457 var fallbackChildFragment;
20458
20459 if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
20460 // In legacy mode, we commit the primary tree as if it successfully
20461 // completed, even though it's in an inconsistent state.
20462 primaryChildFragment = progressedPrimaryFragment;
20463 primaryChildFragment.childLanes = NoLanes;
20464 primaryChildFragment.pendingProps = primaryChildProps;
20465
20466 if ( workInProgress.mode & ProfileMode) {
20467 // Reset the durations from the first pass so they aren't included in the
20468 // final amounts. This seems counterintuitive, since we're intentionally
20469 // not measuring part of the render phase, but this makes it match what we
20470 // do in Concurrent Mode.
20471 primaryChildFragment.actualDuration = 0;
20472 primaryChildFragment.actualStartTime = -1;
20473 primaryChildFragment.selfBaseDuration = 0;
20474 primaryChildFragment.treeBaseDuration = 0;
20475 }
20476
20477 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
20478 } else {
20479 primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
20480 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);
20481 }
20482
20483 primaryChildFragment.return = workInProgress;
20484 fallbackChildFragment.return = workInProgress;
20485 primaryChildFragment.sibling = fallbackChildFragment;
20486 workInProgress.child = primaryChildFragment;
20487 return fallbackChildFragment;
20488 }
20489
20490 function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) {
20491 // The props argument to `createFiberFromOffscreen` is `any` typed, so we use

Callers 1

updateSuspenseComponentFunction · 0.70

Calls 2

createFiberFromFragmentFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…