I have a strange issue. I am working with a list of components in a parent component. Basically I want to change one of the props and to reset all of the child components.
Here is the code I'm using to do that.
for (let i = 0; i < this.numOfNodes; i ++){
let idNum = 'a' + i;
this.passNodes[i] = idNum;
let num = Math.floor(Math.random() * this.numOfMeetings);
this.nodeMeeting[idNum] = this.meetings[num];
let iid = this.passNodes[i];
this.nodes[i] = <Person infected = {false} reset = {true} id={iid} meeting={this.nodeMeeting[iid]} parentCallback = {this.callbackFunction} key={iid}/>
}
console.log(this.nodes[0])
console.log(this.nodes)
This issue I am having, is with the two log statements at the bottom. For the first log statement, it prints the index into the list and in the props, reset is true, as I want it.
However, in the second log statement, when I print out the entire this.nodes, it seems that each of them haven't been updated as reset is still false for all the nodes.
I was wondering if I could get some help.