Skip to content
Discussion options

You must be logged in to vote

Hii @BittuChan, thanks for writing it up so clearly. I ran into this exact problem migrating a Next.js app from v3 to v4. I had cross-field validation everywhere password confirmations, date range pickers, conditional required fields based on a toggle and all of it broke overnight when ctx.parent was removed.

What I tried (and why each fell short):

  • Object-level .superRefine() - Works for validation logic, but React Hook Form maps errors by field path. When the error lives on the parent object, the individual field doesn't show it. We had to write custom error-mapping glue code that felt wrong.
  • Splitting validation into Zod + manual checks - Ended up with validation logic in two places. B…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BittuChan
Comment options

Answer selected by BittuChan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants