react-formal
Version:
Classy HTML form management for React
17 lines (16 loc) • 599 B
TypeScript
import { Errors } from './types';
type UseErrorOptions = {
inclusive?: boolean;
};
/**
* Returns the field errors for the form, or a subset of field errors if paths is provided.
*
* @param paths a path or set of paths to retrieve errors for.
* @param options
* @param {boolean=} options.inclusive By default, only errors with exact matches on each path are returned.
* Set to `false` to also return errors for a path and any nested paths
*
* @returns {Errors}
*/
declare function useErrors(paths?: string | string[], { inclusive }?: UseErrorOptions): Errors;
export default useErrors;