Add zod validation to your instant schema.
addZod
function. This example shows a few different zod examples.
makeLinkRequired
is a helper function that makes a link field required with a custom zod error message.
number | string
for dates, which is why we use z.number() for validation and a number value for the default.form.Field
component.
field.state.meta.errors
is an array of zod errors that you can use to show custom error messages.getErrorMessageForField
is a helper function that returns a concatenated string of all the error messages.