TanStackT
TanStack10mo ago
8 replies
spontaneous-moccasin

Nested form with subForm validation

The use case is something like having
user: {
firstName,
lastName,
address: { ... }
}

And i want to show the address on a separate form inside a modal. and its own front end validation, but when i click "save" it would copy the values to the parent form. Is here a proper API for this?

I assume it should be handled as a separate form to prevent the parent values from changing, then merged into the parent form with ... formState? is there an API to update multiple fields as once?
Was this page helpful?