I am using AG-Grid in my app.
"ag-grid-community": "25.0.1",
It is used as below
<DataGrid
id="myGrid"
onCellClicked={onCellClicked}
{...props}
/>
const onCellClicked = (e) => {
console.log(e);
history.push("/SomeRoute");
}
Now, in SomeRoute, API call is made on load as below;
useEffect(() => {
getMyData();
}, []);
const getMyData = async () => {
// Some fetch call
}
Now the issue I am observing is on click of any of the data grid rows; while it does update the URL in the address bar, it seems to be taking a long time to initiate the API call, and thus, the page loads after a lag.
What could be the possible issue why it takes time to initiate the API call?