diff --git a/package-lock.json b/package-lock.json index 57bd643f..76c996c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1699,9 +1699,9 @@ } }, "node_modules/@hookform/resolvers": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.0.1.tgz", - "integrity": "sha512-u/+Jp83luQNx9AdyW2fIPGY6Y7NG68eN2ZW8FOJYL+M0i4s49+refdJdOp/A9n9HFQtQs3HIDHQvX3ZET2o7YA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.2.0.tgz", + "integrity": "sha512-3YI+VqxJQH6ryRWG+j3k+M19Wf37LeSKJDg6Vdjq6makLOqZGYn77iTaYLMLpVi/uHc1N6OTCmcxJwhOQV979g==", "license": "MIT", "dependencies": { "@standard-schema/utils": "^0.3.0" diff --git a/src/hooks/useI18nForm.tsx b/src/hooks/useI18nForm.tsx index 67a4db65..2cf8318d 100644 --- a/src/hooks/useI18nForm.tsx +++ b/src/hooks/useI18nForm.tsx @@ -3,9 +3,17 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useEffect, useMemo } from 'react'; import { useForm, type FieldValues, type UseFormProps, type UseFormReturn } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import type { ZodType, ZodTypeDef } from 'zod'; -type SchemaBuilder = (t: NotifycalTFunction) => ZodType; +// Workaround while we update to Zod 4 +interface Zod3Type { + _output: O; + _input: I; + _def: { + typeName: string; + }; +} + +type SchemaBuilder = (t: NotifycalTFunction) => Zod3Type; // Replicating react-hook-form useForm signature generics (including order) export function useI18nForm<