Skip to content

Commit 02cc936

Browse files
committed
chore: remove redundant hydration code
1 parent 3e3ae92 commit 02cc936

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/svelte/src/internal/client/hydration.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ export function hydrate_block_anchor(anchor_node, is_controlled) {
6868
let fragment = target_node.$$fragment;
6969
if (fragment === undefined) {
7070
fragment = get_hydration_fragment(target_node);
71-
// @ts-ignore remove to prevent memory leaks
72-
target_node.$$fragment = undefined;
7371
}
7472
set_current_hydration_fragment(fragment);
7573
} else {
76-
set_current_hydration_fragment([/** @type {Element} */ (target_node.firstChild)]);
74+
const firstChild = /** @type {Element | null} */ (target_node.firstChild);
75+
set_current_hydration_fragment(firstChild === null ? [] : [firstChild]);
7776
}
7877
}
7978
}

0 commit comments

Comments
 (0)