mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-12 23:47:16 +00:00
Only visit mounted dynamic components
This commit is contained in:
parent
d1d2dacd15
commit
c9075b26c1
1 changed files with 5 additions and 3 deletions
|
@ -126,9 +126,11 @@ pub fn visit_dynamic<V: Visit + ?Sized>(
|
|||
) {
|
||||
match node {
|
||||
DynamicNode::Component(component) => {
|
||||
let scope = component.mounted_scope(index, vnode, vdom).unwrap();
|
||||
let root_node = scope.root_node();
|
||||
visitor.visit_vnode(vdom, root_node)
|
||||
if let Some(scope) = component.mounted_scope(index, vnode, vdom) {
|
||||
if let Some(root_node) = scope.try_root_node() {
|
||||
visitor.visit_vnode(vdom, root_node)
|
||||
}
|
||||
}
|
||||
}
|
||||
DynamicNode::Text(text) => visitor.visit_text(vdom, vnode, &text.value),
|
||||
DynamicNode::Placeholder(_) => visitor.visit_placeholder(vdom, vnode, index),
|
||||
|
|
Loading…
Reference in a new issue