form-test-victor
Version:
# Performant forms and wizard library for React
31 lines • 967 B
TypeScript
import { FieldValues } from '../../shared';
import { FormContextApi } from '../contexts/FormContext';
/**
* Watch field with updates onChange
* If `names` is not specified, watch all values
* @param names (optional) Field names
* @param form (optional) form to use
* @return
* ```
* const { foo } = useOnChangeValues(['foo']);
* useEffect(() => {
* console.log(foo);
* },[])
* ```
*/
export declare function useOnChangeValues(names?: string[], form?: FormContextApi): FieldValues;
/**
* Watch field with updates onBlur
* If `names` is not specified, watch all values
* @param names (optional) Field names
* @param form (optional) form to use
* @return
* ```
* const { foo } = useOnBlurValues(['foo']);
* useEffect(() => {
* console.log(foo);
* },[])
* ```
*/
export declare function useOnBlurValues(names?: string[], form?: FormContextApi): FieldValues;
//# sourceMappingURL=useValues.d.ts.map