Skip to main content

mount

Function mount 

Source
pub fn mount<S, F>(selector: S, render_fn: F)
where S: AsRef<str>, 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

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