@schematic-forms/react
Version:
react adapter for schematic forms
13 lines (12 loc) • 538 B
TypeScript
declare type RT<ValueType, HasDefault extends boolean = false> = HasDefault extends true ? [
ValueType,
(nextVal: ValueType | ((prevValue?: ValueType) => ValueType | undefined)) => void,
string | null
] : [
ValueType | undefined,
(nextVal: ValueType | ((prevValue?: ValueType) => ValueType | undefined)) => void,
string | null
];
declare function useForm<ValueType>(name: string, nullValue: ValueType): RT<ValueType, true>;
declare function useForm<ValueType>(name: string): RT<ValueType>;
export default useForm;