1

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?

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

It somehow doesn't seem to work, it keeps saying it's a React Element... I've found this as well in the meantime: stackoverflow.com/questions/49114768/… , which looks the same, but somehow it works for you both and not for my code :s
@Tempuslight if possible just create a code sandbox link of your code, So that I can check the code or screen shot of select component also help. I can see somehow whole react component is passing as data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.