MCPcopy
hub / github.com/facebook/react / checkIfRootIsPrerendering

Function checkIfRootIsPrerendering

packages/react-reconciler/src/ReactFiberLane.js:408–421  ·  view source on GitHub ↗
(
  root: FiberRoot,
  renderLanes: Lanes,
)

Source from the content-addressed store, hash-verified

406}
407
408export function checkIfRootIsPrerendering(
409 root: FiberRoot,
410 renderLanes: Lanes,
411): boolean {
412 const pendingLanes = root.pendingLanes;
413 const suspendedLanes = root.suspendedLanes;
414 const pingedLanes = root.pingedLanes;
415 // Remove lanes that are suspended (but not pinged)
416 const unblockedLanes = pendingLanes & ~(suspendedLanes & ~pingedLanes);
417
418 // If there are no unsuspended or pinged lanes, that implies that we're
419 // performing a prerender.
420 return (unblockedLanes & renderLanes) === 0;
421}
422
423export function getEntangledLanes(root: FiberRoot, renderLanes: Lanes): Lanes {
424 let entangledLanes = renderLanes;

Callers 5

performWorkOnRootFunction · 0.90
prepareFreshStackFunction · 0.90
renderRootConcurrentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected