Skip to content

Commit e11a1af

Browse files
committed
tweak
1 parent 0aae872 commit e11a1af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
219219
var anchor_node = anchor ?? target.appendChild(create_text());
220220

221221
branch(() => {
222+
var ctx;
222223
if (context) {
223-
push({});
224-
var ctx = /** @type {ComponentContext} */ (component_context);
224+
ctx = push({});
225225
ctx.c = context;
226226
}
227227

@@ -243,8 +243,8 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
243243
/** @type {Effect} */ (active_effect).nodes_end = hydrate_node;
244244
}
245245

246-
if (context) {
247-
pop();
246+
if (context && ctx) {
247+
pop(ctx);
248248
}
249249
});
250250

0 commit comments

Comments
 (0)