Table of Contents

Method When

Namespace
Velvet
Assembly
Velvet.Docs.dll

When(bool, Func<VNode>?)

Conditional rendering. Returns null when condition is false (handled by the Reconciler's null filter).

public static VNode? When(bool condition, Func<VNode>? factory)

Parameters

condition bool

When true, factory is invoked and its result is returned.

factory Func<VNode>

Factory invoked only when condition is true.

Returns

VNode

The VNode produced by factory, or null when condition is false.