How to assign onChange and values to a textField inside a table using reactjs & material ui

Viewed 103

Working Code : https://codesandbox.io/s/proud-snowflake-d2054?file=/src/App.js

I have an Nested Array , and I want to read the values entered inside the table , also im having a option to add new text field as well . I want to know how to assign onchange function and values to these textfields. enter image description here

Also how to discard values on delete button right next to text field.

Since it is an Nested array it is becoming difficult to update values on setState.

1 Answers

You have an array of states with an Id property. Just use array filter by this Id on existing state and assign it back to state

Related