| 18205 | } |
| 18206 | |
| 18207 | function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { |
| 18208 | // If it was the primary children that just suspended, capture and render the |
| 18209 | // fallback. Otherwise, don't capture and bubble to the next boundary. |
| 18210 | var nextState = workInProgress.memoizedState; |
| 18211 | |
| 18212 | if (nextState !== null) { |
| 18213 | if (nextState.dehydrated !== null) { |
| 18214 | // A dehydrated boundary always captures. |
| 18215 | return true; |
| 18216 | } |
| 18217 | |
| 18218 | return false; |
| 18219 | } |
| 18220 | |
| 18221 | var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop. |
| 18222 | |
| 18223 | if (props.fallback === undefined) { |
| 18224 | return false; |
| 18225 | } // Regular boundaries always capture. |
| 18226 | |
| 18227 | |
| 18228 | if (props.unstable_avoidThisFallback !== true) { |
| 18229 | return true; |
| 18230 | } // If it's a boundary we should avoid, then we prefer to bubble up to the |
| 18231 | // parent boundary if it is currently invisible. |
| 18232 | |
| 18233 | |
| 18234 | if (hasInvisibleParent) { |
| 18235 | return false; |
| 18236 | } // If the parent is not able to handle it, we must handle it. |
| 18237 | |
| 18238 | |
| 18239 | return true; |
| 18240 | } |
| 18241 | function findFirstSuspended(row) { |
| 18242 | var node = row; |
| 18243 | |