Replies: 2 comments
-
I am facing the same issue, making changes in the form file when an error is present in the form, makes it show though. Should probably include a full reproducible reproduction to be able to track it down. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You have to add default values. const form = useForm<z.infer>({ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I have some troubles with zod validation error displaying in the FormMessage. I've been following the shadcn documentation on form and input and it's the same, but I can't seem to figure it out why this is not working.
I have this form-input component (did it so that it can be reused)
The zod schema is the following
And the form is used like this
There should be validation errors displayed, but nothing happens
Here is a link to a code sandbox which reproduces the problems https://codesandbox.io/p/devbox/sharp-jasper-z6c4gz?file=%2Fapp%2Fpage.tsx%3A15%2C6
Beta Was this translation helpful? Give feedback.
All reactions