dillon1000/react
Commit
Browse files Add SuspenseList Component (#15902)
* Add SuspenseList component type * Push SuspenseContext for SuspenseList * Force Suspense boundaries into their fallback state In the "together" mode, we do a second render pass that forces the fallbacks to stay in place, if not all can unsuspend at once. * Add test * Transfer thennables to the SuspenseList This way, we end up retrying the SuspenseList in case the nested boundary that just suspended doesn't actually get mounted with this set of thennables. This happens when the second pass renders the fallback directly without first attempting to render the content. * Add warning for unsupported displayOrder * Add tests for nested sibling boundaries and nested lists * Fix nested SuspenseList forwarding thennables * Rename displayOrder to revealOrder Display order has some "display list" connotations making it sound like a z-index thing. Reveal indicates that this isn't really about when something gets rendered or is ready to be rendered. It's about when content that is already there gets to be revealed. * Add test for avoided boundaries * Make SuspenseList a noop in legacy mode * Use an explicit suspense list state object This will be used for more things in the directional case.
Changed paths16 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js ModifiedM packages/react-dom/src/server/ReactPartialRenderer.js ModifiedM packages/react-reconciler/src/ReactFiber.js ModifiedM packages/react-reconciler/src/ReactFiberBeginWork.js ModifiedM packages/react-reconciler/src/ReactFiberCommitWork.js ModifiedM packages/react-reconciler/src/ReactFiberCompleteWork.js ModifiedM packages/react-reconciler/src/ReactFiberNewContext.js ModifiedM packages/react-reconciler/src/ReactFiberSuspenseComponent.js ModifiedM packages/react-reconciler/src/ReactFiberUnwindWork.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js ModifiedA packages/react-reconciler/src/__tests__/ReactSuspenseList-test.internal.js AddedM packages/react/src/React.js ModifiedM packages/shared/ReactSymbols.js ModifiedM packages/shared/ReactWorkTags.js ModifiedM packages/shared/getComponentName.js ModifiedM packages/shared/isValidElementType.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…