import { zodResolver } from "@hookform/resolvers/zod"; import { type UseFormProps, useForm } from "react-hook-form"; import type { z, ZodTypeAny } from "zod"; export function useZodForm( props: Omit>, "resolver"> & { schema: TSchema; }, ) { const form = useForm>({ ...props, resolver: zodResolver(props.schema), }); return form; }