Merge branch 'master' of github.com:DioxusLabs/dioxus into router-2

This commit is contained in:
Adrian Wannenmacher 2022-12-14 17:54:16 +01:00
commit e6b3497c06

View file

@ -95,7 +95,11 @@ impl VirtualDom {
fn drop_scope_inner(&mut self, node: &VNode) {
node.clear_listeners();
node.dynamic_nodes.iter().for_each(|node| match node {
DynamicNode::Component(c) => self.drop_scope(c.scope.get().unwrap()),
DynamicNode::Component(c) => {
if let Some(f) = c.scope.get() {
self.drop_scope(f)
}
}
DynamicNode::Fragment(nodes) => {
nodes.iter().for_each(|node| self.drop_scope_inner(node))
}