Component
A component: a function from props to a JSX element.
A component: a function from props to a JSX element. Components run once; props are read through their getters, so they stay reactive.
Import#
ts
import type { Component } from "@shadow-js/web";
Signature#
ts
type Component<P = Record<never, never>> = (props: P) => JsxChild
Examples#
ts
import type { Component } from "@shadow-js/web";
const Greeting: Component<{ name: string }> = (props) => <p>Hello {props.name}</p>;