Files
probo/apps/trust/src/hooks/useFormWithSchema.ts
Émile Ré c168be6de0 Add import order sorting rules
Signed-off-by: Émile Ré <emile@getprobo.com>
2026-01-22 20:38:37 +04:00

14 lines
359 B
TypeScript

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