File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
packages/svelte/src/internal/client/dom Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -145,16 +145,14 @@ export function child(node) {
145
145
/*#__NO_SIDE_EFFECTS__*/
146
146
export function child_frag ( node , is_text ) {
147
147
if ( hydrating ) {
148
- const first_node = /** @type {Node [] } */ ( node ) [ 0 ] ;
148
+ const first_node = /** @type {import('#client').TemplateNode [] } */ ( node ) [ 0 ] ;
149
149
150
150
// if an {expression} is empty during SSR, there might be no
151
151
// text node to hydrate — we must therefore create one
152
152
if ( is_text && first_node ?. nodeType !== 3 ) {
153
153
const text = empty ( ) ;
154
154
hydrate_nodes . unshift ( text ) ;
155
- if ( first_node ) {
156
- /** @type {DocumentFragment } */ ( first_node . parentNode ) . insertBefore ( text , first_node ) ;
157
- }
155
+ first_node ?. before ( text ) ;
158
156
return text ;
159
157
}
160
158
You can’t perform that action at this time.
0 commit comments