Skip to content

fix: discriminated union for Zod v4 mini#784

Merged
jorisre merged 1 commit into
react-hook-form:masterfrom
eliocapella:zod-discriminated-union-support
Jul 29, 2025
Merged

fix: discriminated union for Zod v4 mini#784
jorisre merged 1 commit into
react-hook-form:masterfrom
eliocapella:zod-discriminated-union-support

Conversation

@eliocapella

Copy link
Copy Markdown
Contributor

Context

When trying out the new Zod v4 mini I noticed that discriminated unions aren't supported.

Changes

  • Adding discriminated unions to the tests
  • Using the current error on invalid union if the errors array is empty

@eliocapella eliocapella changed the title fix: discriminated union for zod fix: discriminated union for Zod v4 mini Jun 19, 2025
@eliocapella

eliocapella commented Jun 19, 2025

Copy link
Copy Markdown
Contributor Author

I'm unable to get bun to work correctly in my computer, it just keeps loading forever when trying to run the tests
Screenshot 2025-06-19 at 10 20 06

@lefuncq

lefuncq commented Jun 27, 2025

Copy link
Copy Markdown

Hey, any plans to release this fix?

@cascornelissen

Copy link
Copy Markdown

As this likely fixes #793, I'd also love a release that includes this change 😍

@jorisre jorisre merged commit 49a0d7b into react-hook-form:master Jul 29, 2025
1 check passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants