Skip to content
Discussion options

You must be logged in to vote

It seems that the issue can be resolved by using standardSchemaResolver instead of zodResolver in the resolver section of client/src/hooks/useUserForm.ts.

import { standardSchemaResolver } from "hookform-resolvers-v5/standard-schema";
...

const useUserForm = () => {
  const formMethods = useForm<CreateUserRequest>({
    resolver: standardSchemaResolver(createUserRequestSchema),
    defaultValues: {
      name: "",
      email: "",
      age: undefined,
    },
  });

References:
https://github.com/react-hook-form/resolvers/blob/master/standard-schema/src/standard-schema.ts
react-hook-form/resolvers#738

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tas-ricken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant