Open
Description
errorMessages
keys should ideally be restricted to ValidityStateKey
unioned with keys in customValidations
.
let formDefinitions: FormSchema = {
inputs: {
name: {
validationAttrs: {
required: true,
},
},
custom: {
customValidations: {
isThisThingValid() { ... }
},
errorMessages: {
// ✅ OK since this matches a customValidation
isThisThingValid: () => { ... }
// ❌ Should fail because nope is not a ValidityStateKey or a customValidation name
nope: () => { ... }
},
},
},
errorMessages: {
// ✅ OK since this matches a ValidityStateKey
valueMissing: () => { ... }
// ❌ Should fail because nope is not a ValidityStateKey or a custom validation name
nope: () => { ... }
}
}