Skip to content

Commit

Permalink
remove from map immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 14, 2024
1 parent bf489cf commit 24683c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/svelte/src/internal/client/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
}

root_event_handles.delete(event_handle);
mounted_components.delete(component);

if (anchor_node !== anchor) {
anchor_node.parentNode?.removeChild(anchor_node);
}
Expand Down Expand Up @@ -293,6 +293,7 @@ export function unmount(component, options) {
const fn = mounted_components.get(component);

if (fn) {
mounted_components.delete(component);
return fn(options);
}

Expand Down

0 comments on commit 24683c4

Please sign in to comment.