Skip to content

Commit 24683c4

Browse files
committed
remove from map immediately
1 parent bf489cf commit 24683c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
252252
}
253253

254254
root_event_handles.delete(event_handle);
255-
mounted_components.delete(component);
255+
256256
if (anchor_node !== anchor) {
257257
anchor_node.parentNode?.removeChild(anchor_node);
258258
}
@@ -293,6 +293,7 @@ export function unmount(component, options) {
293293
const fn = mounted_components.get(component);
294294

295295
if (fn) {
296+
mounted_components.delete(component);
296297
return fn(options);
297298
}
298299

0 commit comments

Comments
 (0)