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

276
Visualizações
JSX Text Input doesn't work if it has an onChange property (React)

I'm having an issue where any text input that has an onChange property will not let me type in it. I still do have a milisecond of time that I can type something in it, but I can barely type one letter at a time if I really try.

The way I usually solved this problem was to get the value of the input once using document.getElementById().value, instead of having a function that does it automatically.

Basically I did this

<input id="something" type="text" />
<button onClick={() => doSomething(document.getElementById("something").value)}>Click Me!</button>

instead of this,

<input value={value} onChange={e => setValue(e.target.value)} />
<button onClick={() => doSomething(value)}>Click Me!</button>

but now I need to do some real time updates so I need this method.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It turns out that somehow the fix was to just make on giant React component that stores all the code instead of smaller, organized components.

about 4 years ago · Juan Pablo Isaza Relatório
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