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 | Children | Children to be wrapped. |
| props | optional Omit<TProps, “children”> | Props to pass to the wrapper component. |
| when | boolean | When 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. |