isValid

Checks whether a specific field or the entire form is valid by walking through the field store and all its descendants. A field is valid when neither it nor any of its descendants contains an error.

const valid = isValid<TSchema>(form);
const valid = isValid<TSchema, TFieldPath>(form, config);

Generics

Parameters

Explanation

The form parameter is the form store to check for validity. The optional config parameter scopes the check to a specific field's subtree via a path (when omitted, the entire form is checked). The function walks through the field store and all its descendants and returns false as soon as it finds an error.

Returns

  • result boolean

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