VoidProps
Props of a component that takes no children: passing children is a type error.
Props of a component that takes no children: passing children is a type error.
Import#
ts
import type { VoidProps } from "@shadow-js/web";
Signature#
ts
type VoidProps<P = Record<never, never>> = P & { children?: never }
Examples#
ts
import type { VoidProps } from "@shadow-js/web";
function Avatar(props: VoidProps<{ src: string }>) {
return <img src={props.src} alt="" />;
}