Skip to content
Advertisement

How to store the new updated values with keys from slider Material UI ReactJS

As given in below code, I store the state, and also I am getting values in the “value” variable after using onChange={(...)=>setValue1(...)}, value.target.ariaValueText.
My motive is I want to associate it with {key} mentioned in <Form.Lable>, so that I can store updated value along with the keys.

JavaScript

Advertisement

Answer

You can update your type to be an object type to store key-value pairs. for eg:

JavaScript

If you have multiple sliders you’d have to do something like

JavaScript

to not lose other key-value pairs

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement