Skip to main content

patch_node

Function patch_node 

Source
pub fn patch_node(
    old: &VNode,
    new: &VNode,
    parent: &Node,
    anchor: Option<&Node>,
) -> Option<Node>
Expand description

Patch old VNode tree into new VNode tree in-place within parent.

Returns the (possibly new) root DOM node for the patched subtree. When old and new are the same type, the existing DOM node is reused and only the differences are applied (attributes, events, children). When they differ, the old DOM node is replaced entirely.