validatorjs how to set the error as messages code example
Example 1: validatorjs get all errors
const afterValidation = new Validator(finalForm, validationRules);
if (afterValidation.fails()) {
const errorList = afterValidation.errors.all();
}
Example 2: validatorjs number
const validationRule = 'required|numeric';