Skip to content

Commit 12ad1aa

Browse files
committed
fix
1 parent 5554526 commit 12ad1aa

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { DEV } from 'esm-env';
2-
import { append_child, create_element, empty, init_operations } from './dom/operations.js';
2+
import {
3+
append_child,
4+
clear_text_content,
5+
create_element,
6+
empty,
7+
init_operations
8+
} from './dom/operations.js';
39
import { PassiveDelegatedEvents } from '../../constants.js';
410
import { remove } from './dom/reconciler.js';
511
import { flush_sync, push, pop, current_component_context } from './runtime.js';
@@ -170,9 +176,9 @@ export function hydrate(component, options) {
170176
: ''),
171177
error
172178
);
173-
remove(nodes);
174-
first_child.remove();
175-
nodes[nodes.length - 1]?.nextSibling?.remove();
179+
180+
clear_text_content(container);
181+
176182
set_hydrating(false);
177183
return mount(component, options);
178184
} else {

0 commit comments

Comments
 (0)