Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
Error Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name') in React-hook-form

To validate the form, I decided to use the react-hook-form library, when you select the last name in the input in the console, an error occurs as in the screenshot. The input itself is a dadata library and I prescribe all the necessary attributes for the react-hook-form to the component, I think that's why the error occurs, what should I do? And how can this be resolved? I removed all the unimportant part of the code if that.

error screenshot

export default function Fio () {
    const { register, formState: { errors } } = useForm();
    const [value, setValue] = useState();
    return (
        <>
            <span id="FIO">ФИО</span>
            <FioSuggestions
                token={token}
                value={value}
                onChange={setValue}
                {...register( "fio",{required: true})}/><br/>
            <div style={{height: 40}}>
                {errors?.fio && <p>Error</p>}
            </div>
        </>
    )
}
export default function Form () {
    const {handleSubmit} = useForm();
    const onSubmit = (data) => {
        alert(JSON.stringify(data))
    }
        return(
            <form id="formAdv" onSubmit={handleSubmit(onSubmit)}>
                <Fio/>
                <Birthday/><br/>
                <Phone/><br/>
                <label>
                    <input type="radio"
                           name="gender"
                           value="MALE"
                           /> Мужчина
                    <input type="radio"
                           name="gender"
                           value="FEMALE"
                           /> Женщина
                </label><br/>
                <Multiselector/><br/>
                <Selector/><br/>
                <label>
                    <input type="checkbox"/> Не отправлять СМС.
                </label><br/>
                <input type="submit"/>
            </form>
        )
    }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda