I want to update my state setApiResponse in ondownloadprogress event, on console.log, it's showing data coming through, but when I set my state, it's not updating my state and displaying data.
axios({
method: "get",
url: "http://localhost:3005/tables",
onDownloadProgress: (progressEvent) => {
console.log(progressEvent.currentTarget.response);
setApiResponse([progressEvent.currentTarget.response, ...apiResponse]);
},
})
Simply, getting a response by using the response parameter is possible but it's taking time to display data in the table, I want this method to work to display data on the table as soon as data comes through. This will lead to faster rendering and response time. Any solution related to this?