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

355
Views
Path.split is not a function in react Hook Form?

I am using React-Hook-Forms and I have a custom component for my input:

   export default function Input({
  name,
  label,
  value,
  placeholder,
  register,
  ...props
}: IProps) {
  const { control } = useForm();

  return (
    <div className="inputDefaultContainer ">
      <label htmlFor={name}>{label}</label>
      <input
        type="text"
        ref={register}
        name={name}
        className="poppins my-2"
        placeholder={placeholder}
        value={value}
        {...props}
      />
    </div>
  );
} 

I am using this in my form (which have more fields, that are similar to the Input):

const { control, handleSubmit, register } = useForm();
<form onSubmit={handleSubmit(postData)}>
          <div className="input-box">
            <Input
              name="precoProduto"
              label="Preço:"
              register={register}
              placeholder="R$ 00,00"
            />   
          </div>
        <div className="save">
          <SaveBtn />
        </div>
      </form>

The when I try to use the "Register" is getting the following error. Can you help me to resolve this?

get.ts:11 Uncaught TypeError: path.split is not a function
at get (get.ts:11:1)
at register (createFormControl.ts:924:1)
at commitAttachRef (react-dom.development.js:20875:1)
at commitLayoutEffects (react-dom.development.js:23431:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
at invokeGuardedCallback (react-dom.development.js:4056:1)
at commitRootImpl (react-dom.development.js:23151:1)
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority$1 (react-dom.development.js:11276:1)
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!