Cond
This component is used to conditionally render components.
The cond component takes a condition and two components.
If the condition is True
, the first component is rendered, otherwise the second component is rendered.
Text 1
The second component is optional and can be omitted.
If it is omitted, nothing is rendered if the condition is False
.
Negation
You can use the logical operator ~
to negate a condition.
Multiple Conditions
You can use the logical operators &
and |
to combine multiple conditions.
True & True => True
True & False => False
True | False => True
API Reference
rx.components.core.Cond
Render one of two components based on a condition.