Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!