I didn't find any suitable answer for this question. Here is what I am looking for.
- I have lists of menus items coming from the state array variable (https://i.stack.imgur.com/rOWg2.png).
- I have an add button which opens a modal. Modal includes an input field. (https://i.stack.imgur.com/a0COe.png)
- The final result would be when some click adds button of modal, its field values updated in menus state array. which further updates the menus list on UI.
I able to made all these UI. But I didn't have any idea how can I pass my data from modal input to menus list. Here is codesandebox link of the same problem (https://kx6yr.csb.app/).