Skip to content

Commit

Permalink
fix: untrack around all on_cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni-Tably committed Jun 20, 2024
1 parent cca3f1f commit 9e6996a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions leptos_reactive/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ impl Runtime {
| ScopeProperty::Effect(node) => {
// run all cleanups for this node
let cleanups = { self.on_cleanups.borrow_mut().remove(node) };
// untrack around all cleanups
let prev_observer = self.observer.take();
for cleanup in cleanups.into_iter().flatten() {
cleanup();
}
self.observer.set(prev_observer);

// clean up all children
let properties =
Expand Down

0 comments on commit 9e6996a

Please sign in to comment.