houseform
Version:
Simple to use React forms, where your validation and UI code live together in harmony.
11 lines (10 loc) • 562 B
TypeScript
import { ForwardedRef } from "react";
import { FieldInstance, FieldInstanceProps } from "./types";
export interface FieldRenderProps<T = any, F = any> extends FieldInstanceProps<T, F> {
children: (props: FieldInstance<T, F>) => JSX.Element;
}
declare function FieldComp<T = any, F = any>(props: FieldRenderProps<T, F>, ref: ForwardedRef<FieldInstance<T, F>>): JSX.Element;
export declare const Field: <T = any, F = any>(props: FieldRenderProps<T, F> & {
ref?: ForwardedRef<FieldInstance<T, F>> | undefined;
}) => ReturnType<typeof FieldComp>;
export {};