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

243
Visualizações
How to fire React.ChangeEvent from radio button?

This is one of my radio buttons:

<input
    type="radio"
    value="0"
    id="0"
    name="salary"
    checked={salaryRange === "0"}     // Side question: is this the way to handle the active button?
    onChange={() => handleChange}     // Round brackets here seem unnecessary
/>;
0 - 1.0;

And this is my handleChange. Currently, it doesn't fire at all.



    function handleChange(
        e: React.ChangeEvent<HTMLInputElement>,
        range: string
    ) {
        console.log("changed radio button");
    }

I'm not getting any TS errors. Can anyone help?

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

0

You are passing the handleChange function ref.

change onChange={() => handleChange}

to onChange={handleChange} or to onChange={(thatsMySweetEvent) => handleChange(thatsMySweetEvent)}

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