UNPKG

houseform

Version:

Simple to use React forms, where your validation and UI code live together in harmony.

16 lines (15 loc) 767 B
import { MutableRefObject } from "react"; import { FieldInstance } from "./types"; import { FieldArrayInstance } from "../field-array"; export interface UseFieldLikeSyncProps<T, F, TT extends FieldInstance<T, F> | FieldArrayInstance<T, F>> { fieldInstanceRef: MutableRefObject<TT>; props: TT["props"]; value: TT["value"]; errors: TT["errors"]; isDirty: TT["isDirty"]; isValid: TT["isValid"]; isTouched: TT["isTouched"]; isValidating: TT["isValidating"]; preserveValue?: boolean; } export declare const useFieldLikeSync: <T, F, TT extends FieldInstance<T, F> | FieldArrayInstance<T, F>>({ fieldInstanceRef, props, value, errors, isDirty, isValid, isTouched, isValidating, preserveValue, }: UseFieldLikeSyncProps<T, F, TT>) => void;