import { useFormContext } from "react-hook-form";
export function TextAreaInput({
name,
label = "Label",
autocomplete = "off",
placeholder = "",
required,
}: {
name: string;
label: string | undefined;
autocomplete?: string | undefined;
placeholder?: string | undefined;
required: boolean;
}) {
const {
register,
formState: { errors },
} = useFormContext(); // retrieve all hook methods
return (
<>
{errors?.[name] && errors[name].message}
>
);
}