useErrors

    API

    import { useErrors } from 'react-formal';
    • useErrors(paths?: string | string[], options: UseErrorOptions) => Errors

      Returns the field errors for the form, or a subset of field errors if paths is provided.

      Parameters

      • paths?string | string[]

        a path or set of paths to retrieve errors for.

      • optionsUseErrorOptions
        • inclusive?boolean

          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

      Return Value
      Errors