Wrap
Conditionally wrap the children of this component with the component given to
with and passing props to it.
import { Wrap } from "@alloy-js/core";
<Wrap props={Omit<TProps, "children">} when with={ComponentDefinition<TProps>}> {children}</Wrap>import { Wrap } from "@alloy-js/core/stc";
Wrap({ props: Omit<TProps, "children">, when: boolean, with: ComponentDefinition<TProps>,}).children(children)| children | ChildrenChildren to be wrapped. |
| props | optionalOmit<TProps, “children”>Props to pass to the wrapper component. |
| when | booleanWhen true, the children will be wrapped with the provided component. Otherwise, the children will be rendered as is. |
| with | ComponentDefinition<TProps>Component to be used for wrapping. |