Skip to content

Commit 41e3dd9

Browse files
committed
Unmount not deferred components immediately
1 parent 2b85d2a commit 41e3dd9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/cuddly-owls-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: unmount not deferred components immediately

packages/svelte/src/internal/client/dom/blocks/svelte-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export function component(node, get_component, render_fn) {
5151

5252
var defer = should_defer_append();
5353

54-
if (effect) {
54+
// For sync context: immediately pause the old effect
55+
if (!defer && effect) {
5556
pause_effect(effect);
5657
effect = null;
5758
}

0 commit comments

Comments
 (0)