FlowComponent
A component that requires children of type C, such as Show (children are the content it shows) or a For callback.
A component that requires children of type C, such as Show (children are the content it
shows) or a For callback.
Import#
ts
import type { FlowComponent } from "@shadow-js/web";
Signature#
ts
type FlowComponent<P = Record<never, never>, C = JsxChild> = Component<P & { children: C }>
Examples#
ts
import type { FlowComponent, JSX } from "@shadow-js/web";
const Repeat: FlowComponent<{ times: number }, (index: number) => JSX.Element> = (props) =>
Array.from({ length: props.times }, (_, index) => props.children(index));