import { useForm } from "react-hook-form"; import type { z, ZodType } from "zod"; import { zodResolver } from "@hookform/resolvers/zod"; export function useFormWithSchema>( schema: T, options: Parameters>>[0] ) { return useForm>({ ...options, resolver: zodResolver(schema), }); }