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

300
Visualizações
How to send event and object as parameters to Javascript eventlistener function?

So I'm writing Javascript and using a Material Ui Select component. This component has a parameter "onChange" which triggers if a new drop-down item is selected.

onChange={(event) => {
    let newObj = {
        'param1': value1,
        'param2': value2,
        ...
    }
    handleChangeTemplates(event, newObj);
}}

When debugging the function "handleChangeTemplates", it receives the "event" object correctly, but does something weird (to me anyway) with the other object. Here's how it looks during debugging:

valuesObject image

How can I properly send all my parameters that I need to the function, during the "onChange" event?

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

0

I am not sure how whole code looks like but valuesObj somehow pointing react element.

I have created same component in code sandbox an it working fine. Please check that, It may help.

https://codesandbox.io/s/basicselect-material-demo-forked-mnc45?file=/demo.js

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