Skip to main content

create_dynamic_node_with_context

Function create_dynamic_node_with_context 

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

Constructs a VirtualNode::Dynamic for match expressions where arm hook isolation is required. The render closure receives a &mut HookContext so it can call set_arm_changed before each arm body.

§Arguments

  • FnMut(&mut HookContext) -> VirtualNode + 'static - The render closure that receives a mutable reference to the hook context.

§Returns

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