import React from 'react'; import { useFormContext } from "react-hook-form"; import { Alert } from './' type Props = { text: string; name: string; placeholder: string; additional: string; } export const Input: React.FC = ({text, name, placeholder, additional}) => { const { register, formState: { errors } } = useFormContext(); const options = {required: true, maxLength: 80, additional}; console.log(errors.name); return( <> {errors[name] && } ) }