File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/components/forms/public Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import { submitResponse } from '@/app/actions/forms';
2121
2222import { FieldRenderer } from '../renderer' ;
2323import { buildResponseDefaults } from './form-defaults' ;
24- import { buildResponseSchema } from './response-schema' ;
24+ import { buildResponseSchema , ResponseFormValues } from './response-schema' ;
2525
2626interface PublicFormProps {
2727 form : Form ;
@@ -40,7 +40,7 @@ export const PublicForm: FC<PublicFormProps> = ({ form }) => {
4040 control,
4141 handleSubmit,
4242 formState : { isSubmitting } ,
43- } = useForm ( {
43+ } = useForm < ResponseFormValues > ( {
4444 resolver : zodResolver ( schema ) ,
4545 defaultValues : defaults ,
4646 } ) ;
Original file line number Diff line number Diff line change @@ -64,3 +64,7 @@ export const buildFieldSchema = (field: FormField): z.ZodTypeAny => {
6464 return z . unknown ( ) ;
6565 }
6666} ;
67+
68+ export type ResponseFormValues = z . infer <
69+ ReturnType < typeof buildResponseSchema >
70+ > ;
You can’t perform that action at this time.
0 commit comments