pub fn create_dynamic_node_with_context<F>(render_fn: F) -> VirtualNodeExpand 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.
This function replaces the inline HookContext + DynamicNode setup that
was previously generated for match nodes, where the hook context had to be
accessible inside the render closure for arm switching.
§Arguments
FnMut(&mut HookContext) -> VirtualNode + 'static- The render closure that receives a mutable reference to the hook context. The closure is responsible for callingset_arm_changedbefore each match arm.
§Returns
VirtualNode- AVirtualNode::Dynamicwrapping the render closure with a freshHookContext.