Skip to main content

create_dynamic_node

Function create_dynamic_node 

Source
pub fn create_dynamic_node<F>(render_fn: F) -> VirtualNode
where F: FnMut() -> VirtualNode + 'static,
Expand description

Constructs a VirtualNode::Dynamic from a render closure with hook context management.

This function replaces the boilerplate that was previously generated inline by the html! macro for every Dynamic, If, Match, and For node. The macro now emits euv_core::create_dynamic_node(render_fn) instead of the full HookContext + DynamicNode + render_fn setup block.

§Arguments

  • FnMut() -> VirtualNode + 'static - The render closure that produces a virtual node tree. Called on initial render and on every signal update.

§Returns

  • VirtualNode - A VirtualNode::Dynamic wrapping the render closure with a fresh HookContext.