Generate a dynamic zod schema for a user created form
If a user is creating a form we output this:
how do i generate a schema to use in the react-hook-form zod resolver to validate the fields? notice how we have sections->fields, and each field has a "required" which indicates true/false, and then "response" is where we capture the response. we generate a different field object to represent required/optional based on the "type" of the field, e.g. "textfield" is a basic zod object string
i've tried several things
0 Replies