VoidComponent is another SolidJS type alias mentioned on https://www.solidjs.com/guides/typescript#component-types. It's a shorthand for a component that has no children prop, and therefore could be written as self-closing in JSX (e.g. <img />).
// from solid-js type definitions:
type VoidProps<P = {}> = P & { children?: never };
type VoidComponent<P = {}> = Component<VoidProps<P>>;
Changes
[X] Support VoidComponent in the same places that ParentComponent is supported
[X] Add passing unit test to cover usage of VoidComponent
Description
VoidComponent
is another SolidJS type alias mentioned on https://www.solidjs.com/guides/typescript#component-types. It's a shorthand for a component that has nochildren
prop, and therefore could be written as self-closing in JSX (e.g.<img />
).Changes
VoidComponent
in the same places thatParentComponent
is supportedVoidComponent