Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

350
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda