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