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

372
Views
Uncaught TypeError: path.split is not a function while using react hook forms and material ui

consider the following block of code:

 <TextField name="name" required className='my-2 mx-auto' label="Full Name" variant="standard" style={{ "width": "60%" }} value={name} onChange={(event) => { setName(event.target.value); }} {...register({
            required: "Name is required"
   })} />

I have replaced the ref with ...register but I am still getting the error, can someone please help me fix it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No you can't do this because TextField is not only an input.

I think you have to pass {...register({ required: "Name is required"})} to the TextField's input and to do that, you could use TextField's inputProps prop. Something like:

 <TextField 
    name="name" 
    required 
    className='my-2 mx-auto' 
    label="Full Name" 
    variant="standard" 
    style={{ "width": "60%" }} 
    value={name} 
    onChange={(event) => { setName(event.target.value); }} 
    inputProps={{...register({required: "Name is required"})}}
 />
about 4 years ago · Juan Pablo Isaza Report
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!