From 4fb13ce37f42e08c571b15f0939561bd4a2b64bf Mon Sep 17 00:00:00 2001 From: Ninad Sinha Date: Mon, 5 Sep 2022 01:27:27 +0530 Subject: [PATCH] (bugfix) fix useEffect missing dependancy array warnings for gcp and aws connections --- .../ConnectionConfiguration/AWS/instance_selection.tsx | 4 +++- .../components/ConnectionConfiguration/AWS/os_selection.tsx | 3 ++- .../GCP/destination_instance_config.tsx | 2 +- .../components/ConnectionConfiguration/common/genericStep.tsx | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ConnectionConfiguration/AWS/instance_selection.tsx b/frontend/src/components/ConnectionConfiguration/AWS/instance_selection.tsx index 8804623a..371e2807 100644 --- a/frontend/src/components/ConnectionConfiguration/AWS/instance_selection.tsx +++ b/frontend/src/components/ConnectionConfiguration/AWS/instance_selection.tsx @@ -42,6 +42,7 @@ const InstanceSelection: React.FC = ({ }) const toast = useToast() + useEffect(() => { if (isCurrent) { setLoadingState(true) @@ -66,7 +67,8 @@ const InstanceSelection: React.FC = ({ }) .finally(() => setLoadingState(false)) } - }, [selectedInstanceSpecs, isCurrent]) + }, [selectedInstanceSpecs, toast, isCurrent, id, setLoadingState]) + if (instances != null) { return ( = ({ }) .catch(err => {}) } - }, [isCurrent]) + }, [isCurrent, id]) + if (OSChoices != null) { return ( = ({ console.warn(err) }) } - }, [isSelected]) + }, [isSelected, id, toast]) return ( = ({ if (isCurrent) { complete({}) } - }, [isCurrent]) + }, [isCurrent, complete]) + return (