UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

12 lines (11 loc) • 682 B
/** * Props a schema node must never pass to a component (§10.8). Schema props are * untrusted: default layouts and fields spread unknown props onto DOM elements, so a JSON * `dangerouslySetInnerHTML` or `javascript:` URL would reach the page. `parseFormSchema` rejects * these, and the renderer strips them (defence in depth for schemas that skip the parser). */ /** * Why a prop is not allowed on a schema node, or `undefined` when it is fine. `onField`: the node * is a field node, whose `type` may not make its input a button, file picker or hidden input. */ export declare function unsafePropReason(key: string, value: unknown, onField?: boolean): string | undefined;