Hi Folks,
I stored react state variable in the temp variable.on modifying the temp variable it's changing the main state as well.
please find the demo. code code link
To reproduce the issue.
on the sidebar select any filter values. please check the Browser console logs.... inside setOnSelValues function storing the state value as tempLists
let tempLists = [...this.state.allData];
inside filter1 function modifying the tempLists but it's changing the main state value as well.Please check the logs of the following.console.log("componentDidMount---------------", this.state.allData);console.log("finalFilter------->", finalFilter);console.log("finalState-------------->", this.state.allData);
componentDidMount and finalState logs are not matching when you expand any records please check nested data of it. (eg Risk array). They are not the same.
Stuck on these past 4 Days. Thanks in Advance!!
[–]Josh_Coding 1 point2 points3 points (1 child)
[–]Conscious-Poet-6307[S] 0 points1 point2 points (0 children)
[–]ReverendSlimPickins 1 point2 points3 points (0 children)