problem description
how do I modify the value of an element in an array? The name of this property of the array to be modified is the passed parameter.
the environmental background of the problems and what methods you have tried
In theReact project, a public method for modifying values is written, in which the array needs to be modified according to the passed subscript, attribute name, and value
related codes
changeDate = (index, el, value) => {
let { newData } = this.state;
newData[index].el = value //
}
what result do you expect? What is the error message actually seen?
for React or rookie, Baidu has not found the answer. Please give me some advice. Thank you.