diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 56412ee84d..fa8923c005 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -374,13 +374,15 @@ function remove_reaction(signal, dependency) { // allows us to skip the expensive work of disconnecting and immediately reconnecting it (new_deps === null || !new_deps.includes(dependency)) ) { - set_signal_status(dependency, MAYBE_DIRTY); // If we are working with a derived that is owned by an effect, then mark it as being // disconnected and remove the mark flag, as it cannot be reliably removed otherwise if ((dependency.f & CONNECTED) !== 0) { dependency.f ^= CONNECTED; dependency.f &= ~WAS_MARKED; } + + update_derived_status(dependency); + // Disconnect any reactions owned by this reaction destroy_derived_effects(/** @type {Derived} **/ (dependency)); remove_reactions(/** @type {Derived} **/ (dependency), 0);