I have state like below:
this.state = {
data: [ .... ]
misc: [ .... ]
}
I have button when clicked it will fetch data.
the data will be fetched using axios and then setState is used to replace the this.state.data
Then as per reactjs render will be called every time you setState to re-render the component if there are changes.
After this.state.data is updated, and rendering is complete i want to run a function.
I dont want to run the function when misc is updated. I only want to update when data is updated
How to run a function after render only when this.state.data is changed