Languages

React - How can I change the state of my data with Material UI menu item when the user select one option

3 points
Asked by:
sarah kacem
1030

I'm using Material UI to create table and allow the user to change the actual information that he saved in the database, so I'm using React and here is my actual code:

How I can add the value selected to my state ? (I also need to say that I already map my data, so I can directly access to them using "game.")

1 answer
8 points
Answered by:
Root-ssh
178290

Is it right way you use value prop?

Use this way:

or: 

Result:

See also

  1. React - Material-UI Select component with array of objects 
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join