Skip to content

Type Alias: ComponentFn<C, K>

API / @xmachines/play-solid / ComponentFn

type ComponentFn<C, K> = (ctx) => JSX.Element;

Defined in: @json-render/solid

Component render function type for Solid

Type Parameters

Type Parameter
C extends Catalog
K extends keyof InferCatalogComponents<C>

Parameters

ParameterType
ctxComponentContext<C, K>

Returns

JSX.Element

Example

const Button: ComponentFn<typeof catalog, 'Button'> = (ctx) => (
<button onClick={() => ctx.emit("press")}>{ctx.props.label}</button>
);