TanStackT
TanStackโ€ข11mo agoโ€ข
7 replies
then-purple

Handling nested object validations

Hey there, im currently running into an issue with
zod
validations (more like a general issue). Im having a field like schema.output . output is like an object with different values object: { value: string, id: string} and i want to use the AppField
object
and then display the errors inside. But whenever im accessing the "top level", meaning output the errors are not there, because theyre happening on e.g.
value
with min(1). unless i dig into field.form.stateand extract the errors from there, i dont see any way to handle those "complex" forms. Its crucial for me, because im running into many scenarios where i need to validate an object rather than one field from the object, since theyre quite complex objects.

cheers and thanks in advance ๐Ÿ™‚
Was this page helpful?