Skip to content

Commit a838aeb

Browse files
committed
Just check if the parentNode is gone
1 parent 5c1bf21 commit a838aeb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineCodeStrings.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export function revealCompletedBoundaries(batch) {
3434
for (let i = 0; i < batch.length; i += 2) {
3535
const suspenseIdNode = batch[i];
3636
const contentNode = batch[i + 1];
37-
if (contentNode.isConnected) {
37+
if (contentNode.parentNode === null) {
38+
// If the client has failed hydration we may have already deleted the streaming
39+
// segments. The server may also have emitted a complete instruction but cancelled
40+
// the segment. Regardless we can ignore this case.
41+
} else {
3842
// We can detach the content now.
3943
// Completions of boundaries within this contentNode will now find the boundary
4044
// in its designated place.
4145
contentNode.parentNode.removeChild(contentNode);
42-
} else {
43-
// If the client has failed hydration we may have already deleted the streaming
44-
// segments. The server may also have emitted a complete instruction but cancelled
45-
// the segment. Regardless we can ignore this case.
4646
}
4747
// Clear all the existing children. This is complicated because
4848
// there can be embedded Suspense boundaries in the fallback.

0 commit comments

Comments
 (0)