dillon1000/react

Commit

Hydrate using SuspenseComponent as the parent (#22582)

* Add a failing test for Suspense hydration

* Include salazarm's changes to the test

* The hydration parent of a suspense boundary should be the boundary itself

This eventually got set when we popped back out of its children but it
doesn't start out that way.

This fixes it so that the boundary parent is always the suspense boundary.

* We now need to log errors with a suspense boundary as a parent

For now, we just log this with commentNode.parentNode as the parent for
purposes of the error message.

* Make a special getFirstHydratableChildWithinSuspenseInstance

We currently call getNextHydratableSibling but conceptually it's the child
of the boundary. It just happens to be that when we use comment nodes, we
need to call nextSibling in the DOM.

This makes this separation a bit clearer.

* Sync old fork

Co-authored-by: Dan Abramov <[email protected]>
Browse files
Changed paths6 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js ModifiedM packages/react-dom/src/client/ReactDOMHostConfig.js ModifiedM packages/react-reconciler/src/ReactFiberHostConfigWithNoHydration.js ModifiedM packages/react-reconciler/src/ReactFiberHydrationContext.new.js ModifiedM packages/react-reconciler/src/ReactFiberHydrationContext.old.js ModifiedM packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…