UINode
.
export declare class UINode<T extends UIComponentProps = UIComponentProps>
if(condition, trueComponent, falseComponent)
static
|
Conditionally renders the UI element based on the a condition.
Signature
static if(condition: Bindable<boolean>, trueComponent?: UIChildren, falseComponent?: UIChildren): UINode<ConditionalProps>;
Parameters
condition: Bindable<boolean> The condition to check. Accepts a boolean or a binding of a boolean. trueComponent: UIChildren (Optional) The UI element to render when the condition is true. If not provided, nothing is rendered when the condition is true. falseComponent: UIChildren (Optional) The UI element to render when the condition is false. If not provided, nothing is rendered when the condition is false. Returns A UINode that represents the result of the conditional rendering. Although the return type is a UINode, it is not really a node in the DOM tree. The components in the argument, if rendered, will appear in the DOM tree. |