Open denatys opened 3 months ago
formErrors: pet_name: "Required field"
Hi @denatys,
inputTypes
only supports keys that match input types like text
, number
, etc. It does not support generic errorTypes. As the pet_name
is a text
, you need to pass its type like this:
const { fields, handleValidation } = createHeadlessForm(Schema, {
inputTypes: {
text: {
required: 'This cannot be empty.',
},
},
});
We understand that this might not solve what you need (apply a given message to every error type of "required"), so this can be considered a missing feature. If you can, contributions are welcome ✌️
Given the following JSON Schema, I cannot override errorMessage using createHeadlessForm()
JSF Config:
This is very important to be able to i18n in the application