ParentProps
Props of a component that takes optional children: adds children?: JsxChild to P.
Props of a component that takes optional children: adds children?: JsxChild to P.
Import#
ts
import type { ParentProps } from "@shadow-js/web";
Signature#
ts
type ParentProps<P = Record<never, never>> = P & { children?: JsxChild }
Examples#
ts
import type { ParentProps } from "@shadow-js/web";
function Card(props: ParentProps<{ title: string }>) {
return (
<section>
<h2>{props.title}</h2>
{props.children}
</section>
);
}