formsy-react
formsy-react copied to clipboard
Update Validation type
Update Validation type for custom added validators that leverage the extra argument
Tests run directly on the source code and all dist changes are computed and committed during Formsy release.
This resolves the Ts issue regarding validators that leverage the extra argument like so.
validations={ {
'isNumeric': true,
'isGte': min,
'isLte': max,
} }
export function isGte(values, value, min) {
if (!value && value !== 0) {
return true;
}
return value >= min;
}
@th3fallen sorry for the delay, can you elaborate when do you get a type error? (a small example will be really appreciated).
@felixmosh I think I get this. The type error example here is { 'isLte': max }
, where max isn't a boolean or a string or a function, so it does not match the previous type.