import React from 'react'; import { useFormContext } from "react-hook-form"; import { Alert } from './' type Props = { text: string; name: string; placeholder: string; additional: string; value: string; } export const Input: React.FC = ({text, name, placeholder, additional, value}) => { const { register } = useFormContext(); const options = {required: true, maxLength: 80, additional}; //const nameBlock = errors.name; //console.log(errors); return( <> { //nameBlock && Alert('Данное поле незаполнено') } ) }