fn apply(
        &mut self,
        _parent_scope: &AnyScope,
        parent: &Element,
        next_sibling: NodeRef,
        ancestor: Option<VNode>,
    ) -> NodeRef {
        if let Some(mut ancestor) = ancestor {
            if let VNode::VText(mut vtext) = ancestor {
                self.reference = vtext.reference.take();
                let text_node = self
                    .reference
                    .clone()
                    .expect("Rendered VText nodes should have a ref");
                if self.text != vtext.text {
                    text_node.set_node_value(Some(&self.text));
                }

                return NodeRef::new(text_node.into());
            }

            ancestor.detach(parent);
        }

        let text_node = document().create_text_node(&self.text);
        super::insert_node(&text_node, parent, next_sibling.get());
        self.reference = Some(text_node.clone());
        NodeRef::new(text_node.into())
    }
/// Renders virtual node over existing `TextNode`, but only if value of text has changed.
Renders virtual node over existing `TextNode`, but only if value of text has changed.
Renders virtual node over existing ` TextNode ` but only if value of text has changed .
fn apply(
        &mut self,
        _parent_scope: &AnyScope,
        parent: &Element,
        next_sibling: NodeRef,
        ancestor: Option<VNode>,
    ) -> NodeRef {
        if let Some(mut ancestor) = ancestor {
            if let VNode::VText(mut vtext) = ancestor {
                self.reference = vtext.reference.take();
                let text_node = self
                    .reference
                    .clone()
                    .expect("Rendered VText nodes should have a ref");
                if self.text != vtext.text {
                    text_node.set_node_value(Some(&self.text));
                }
                return NodeRef::new(text_node.into());
            }
            ancestor.detach(parent);
        }
        let text_node = document().create_text_node(&self.text);
        super::insert_node(&text_node, parent, next_sibling.get());
        self.reference = Some(text_node.clone());
        NodeRef::new(text_node.into())
    }
fn apply ( & mut self , _parent_scope : & AnyScope , parent : & Element , next_sibling : NodeRef , ancestor : Option < VNode > , ) -> NodeRef { if let Some ( mut ancestor ) = ancestor { if let VNode :: VText ( mut vtext ) = ancestor { self . reference = vtext . reference . take ( ) ; let text_node = self . reference . clone ( ) . expect ( " " ) ; if self . text != vtext . text { text_node . set_node_value ( Some ( & self . text ) ) ; } return NodeRef :: new ( text_node . into ( ) ) ; } ancestor . detach ( parent ) ; } let text_node = document ( ) . create_text_node ( & self . text ) ; super :: insert_node ( & text_node , parent , next_sibling . get ( ) ) ; self . reference = Some ( text_node . clone ( ) ) ; NodeRef :: new ( text_node . into ( ) ) }
Renders virtual node over existing `TextNode`, but only if value of text has changed.
Renders virtual node over existing ` TextNode ` but only if value of text has changed .
&mut self
_parent_scope
&AnyScope
parent
&Element
next_sibling
NodeRef
ancestor
Option<VNode>
&mut self
_parent_scope
&AnyScope
parent
&Element
next_sibling
NodeRef
ancestor
Option<VNode>