import React from 'react'; import { useFormContext } from "react-hook-form"; import { Alert } from './' type Props = { text: string; name: string; placeholder: string; options: string[]; } export const Input: React.FC = ({text, name, placeholder, options}) => { const { register, formState: { errors } } = useFormContext(); return( <> {errors.name && Alert('Введите ФИО тренера команды') } ) }