VoidComponent
A component that takes no children.
A component that takes no children. Use it for leaf components such as an Icon or an Input.
Import#
ts
import type { VoidComponent } from "@shadow-js/web";
Signature#
ts
type VoidComponent<P = Record<never, never>> = Component<VoidProps<P>>
Examples#
ts
import type { VoidComponent } from "@shadow-js/web";
const Icon: VoidComponent<{ name: string }> = (props) => <i class={`icon-${props.name}`} />;