getDeepErrors

Retrieves all error messages of a specific field or the entire form by walking through the field store and all its descendants. This is useful for displaying a summary of all validation errors within a section or the whole form.

const errors = getDeepErrors<TSchema>(form);
const errors = getDeepErrors<TSchema, TFieldPath>(form, config);

Generics

Parameters

Explanation

The form parameter is the form store to retrieve errors from. The optional config parameter scopes the collection to a specific field's subtree via a path (when omitted, the entire form is walked). The function walks through the field store and all its descendants to collect every validation error message.

Returns

  • result [string, ...string[]] | null

Primitives

Methods

Contributors

Thanks to all the contributors who helped make this page better!

  • GitHub profile picture of @fabian-hiller

Partners

Thanks to our partners who support the project ideally and financially.

Sponsors

Thanks to our GitHub sponsors who support the project financially.

  • GitHub profile picture of @vasilii-kovalev
  • GitHub profile picture of @UpwayShop
  • GitHub profile picture of @ruiaraujo012
  • GitHub profile picture of @hyunbinseo
  • GitHub profile picture of @nickytonline
  • GitHub profile picture of @kibertoad
  • GitHub profile picture of @caegdeveloper
  • GitHub profile picture of @Thanaen
  • GitHub profile picture of @bmoyroud
  • GitHub profile picture of @ysknsid25
  • GitHub profile picture of @dslatkin