Merged
Conversation
bluebill1049
approved these changes
Jun 5, 2025
jorisre
approved these changes
Jun 6, 2025
Member
jorisre
left a comment
There was a problem hiding this comment.
Thanks for the black TypeScript magic 🧙♂️ Really appreciate you jumping in and helping out with this. Everything looks solid and comes with a good DX too 🙌
Contributor
|
🎉 This PR is included in version 5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
Amazing! |
Merged
|
Hello, I'm trying to use react-hook-form with zod/v4. //"react-hook-form": "^7.57.0",
import { useForm } from "react-hook-form";
//"@hookform/resolvers": "^5.1.0",
import { zodResolver } from "@hookform/resolvers/zod";
//"zod": "^3.25.57",
import { z } from "zod/v4";
const loginSchema = z.object({
email: z.email("email.invalid"),
password: z
.string()
.nonempty("password.required")
.min(8, "password.minLength"),
});
export const Component = (): void => {
useForm({
resolver: zodResolver(loginSchema),
mode: "onChange",
defaultValues: {
email: "",
password: "",
},
});
};Does anyone have any idea of why this happens? |
Merged
|
Backwards compatibility got broken with this change. In reality, this has been a 'feat!' |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Per some discussions I've been having with @bluebill1049, this PR adds support for Zod 4.
The other PR by @alexcraviotto (#776) is really solid but we decided to go another direction.
3.25.0zodResolver(via Zod's subpath versioning scheme)zodResolver). There were zero breaking changes between Zod 3.24 and Zod 3.25 so there's no reason not to upgrade.Both Zod 3 and Zod 4 schemas can be passed into
zodResolver():