From 706f3d6a96d11c84326e729beaa29ac99f99fcd4 Mon Sep 17 00:00:00 2001 From: mufaddal motiwala Date: Mon, 20 Dec 2021 14:54:26 +0530 Subject: [PATCH] added dependency list in useAsync Signed-off-by: mufaddal motiwala --- .../src/components/NewRelicDashboard/DashboardEntityList.tsx | 2 +- .../DashboardSnapshotList/DashboardSnapshot.tsx | 2 +- .../DashboardSnapshotList/DashboardSnapshotList.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx index aad88e3f44..823055c284 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardEntityList.tsx @@ -51,7 +51,7 @@ export const DashboardEntityList = () => { String(DashboardEntity?.integrationKey), ); return dashboardObject; - }, []); + }, [DashboardEntity?.integrationKey]); if (loading) { return ; } diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx index 17c9e4aa1b..3f72981b97 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshot.tsx @@ -41,7 +41,7 @@ export const DashboardSnapshot = ({ const dashboardObject: Promise = newRelicDashboardAPI.getDashboardSnapshot(guid, duration); return dashboardObject; - }, []); + }, [guid, duration]); if (loading) { return ; } diff --git a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx index 7977ab5818..c839a43ac2 100644 --- a/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx +++ b/plugins/newrelic-dashboard/src/components/NewRelicDashboard/DashboardSnapshotList/DashboardSnapshotList.tsx @@ -88,7 +88,7 @@ export const DashboardSnapshotList = ({ guid }: Props) => { const dashboardObject: Promise = newRelicDashboardAPI.getDashboardEntity(guid); return dashboardObject; - }, []); + }, [guid]); const [value1, setValue1] = useState(0); const handleChange = ({}: React.ChangeEvent<{}>, newValue: number) => { setValue1(newValue);