Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

createErrorVisibility.md

29 lines775 Bytes

function createErrorVisibility(visibility): ReusableErrorVisibility;

Defined in: validation.public.ts:388

Creates an error visibility policy that can be shared across forms with different values.

Use an inline errorVisibility callback instead when the policy needs strongly typed access to the consuming form's values.

Parameters

visibility

(context) => boolean

Returns true to show the field's errors, or false to hide them.

Returns

ReusableErrorVisibility

The policy to assign to a form or field's errorVisibility option.