UNPKG

form-test-victor

Version:

# Performant forms and wizard library for React

26 lines 793 B
import { FieldValue, AnyRecord } from '../../shared'; import { FormContextApi } from '../contexts/FormContext'; /** * Generate methods for form * @return {FormContextApi} * @example * ``` * const form = useForm(); * const { setFormValues } = form; * * useEffect(() => { * setFormValues({"foo": "foo", "bar": "bar"}) * },[]) * * return( * <Form form={form}> * <TextInput name="name" /> * </Form> * ) * ``` */ export interface UseFormOptions { onUpdateAfterBlur?: (name: string, value: FieldValue, data: AnyRecord, formPartial: Pick<FormContextApi, 'getFormValues' | 'setFormValues'>) => Promise<void> | void; } export declare function useForm({ onUpdateAfterBlur }?: UseFormOptions): FormContextApi; //# sourceMappingURL=useForm.d.ts.map