import React from 'react';
import { useController } from 'react-hook-form';
/* eslint-disable react/react-in-jsx-scope */
export const TextArea = ({ control, name, label, required, ...props }: TextAreaProps) => {
const {
field,
// fieldState: { invalid, isTouched, isDirty },
// formState: { touchedFields, dirtyFields },
} = useController({
name,
control,
rules: { required },
defaultValue: '',
});
return (
<>
{label && (
)}
>
);
};
type TextAreaProps = {
control: any;
name: string;
label?: string;
} & React.HTMLProps;