TreeValidatorFn()
type TreeValidatorFn<TForm> = (ctx) => ValidationError | null;
Defined in: core/types/validation-schema.ts:71
Функция cross-field валидации
Type Parameters
TForm
TForm
Parameters
ctx
FormContext<TForm>
Returns
ValidationError | null
Example
validateTree((ctx) => {
const password = ctx.form.password.value.value;
const confirm = ctx.form.confirmPassword.value.value;
if (password !== confirm) {
return { code: 'mismatch', message: 'Passwords must match' };
}
return null;
});