Skip to content

Commit b5d44af

Browse files
committed
prevent transitions during HMR update
1 parent c822846 commit b5d44af

File tree

1 file changed

+5
-2
lines changed
  • packages/svelte/src/internal/client/dev

1 file changed

+5
-2
lines changed

packages/svelte/src/internal/client/dev/hmr.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { block, branch, pause_effect } from '../reactivity/effects.js';
1+
import { block, branch, destroy_effect } from '../reactivity/effects.js';
22
import { set, source } from '../reactivity/sources.js';
3+
import { set_should_intro } from '../render.js';
34
import { get } from '../runtime.js';
45

56
/**
@@ -27,11 +28,13 @@ export function hmr(data, component) {
2728
if (effect) {
2829
// @ts-ignore
2930
for (var k in instance) delete instance[k];
30-
pause_effect(effect);
31+
destroy_effect(effect);
3132
}
3233

3334
effect = branch(() => {
35+
set_should_intro(false);
3436
Object.assign(instance, component(anchor, props));
37+
set_should_intro(true);
3538
});
3639
});
3740

0 commit comments

Comments
 (0)