(suspenseContext, current, workInProgress, renderLanes)
| 20291 | |
| 20292 | |
| 20293 | function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { |
| 20294 | // If we're already showing a fallback, there are cases where we need to |
| 20295 | // remain on that fallback regardless of whether the content has resolved. |
| 20296 | // For example, SuspenseList coordinates when nested content appears. |
| 20297 | if (current !== null) { |
| 20298 | var suspenseState = current.memoizedState; |
| 20299 | |
| 20300 | if (suspenseState === null) { |
| 20301 | // Currently showing content. Don't hide it, even if ForceSuspenseFallback |
| 20302 | // is true. More precise name might be "ForceRemainSuspenseFallback". |
| 20303 | // Note: This is a factoring smell. Can't remain on a fallback if there's |
| 20304 | // no fallback to remain on. |
| 20305 | return false; |
| 20306 | } |
| 20307 | } // Not currently showing content. Consult the Suspense context. |
| 20308 | |
| 20309 | |
| 20310 | return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); |
| 20311 | } |
| 20312 | |
| 20313 | function getRemainingWorkInPrimaryTree(current, renderLanes) { |
| 20314 | // TODO: Should not remove render lanes that were pinged during this render |
no test coverage detected
searching dependent graphs…