Skip to main content

mount

Function mount 

Source
pub fn mount<F>(selector: &str, render_fn: F)
where F: FnOnce() -> VirtualNode,
Expand description

Mounts the given virtual DOM tree to a specific element matched by a CSS selector.

Supported selector syntax:

  • "#id" โ€” select by element ID
  • ".class" โ€” select by class name (uses the first match)
  • "tag" โ€” select by tag name (uses the first match)

ยงArguments

  • &str - A CSS selector string to locate the target element.
  • FnOnce() -> VirtualNode + 'static - A closure that returns the virtual DOM tree to render.