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

298
Views
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 answers
Answer question

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 Report
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!