From c5e257bd929290c91ab2f8a2ab36099046a8c997 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Tue, 19 Nov 2024 11:50:20 +0300 Subject: [PATCH] (fix) Fix react hooks exhaustive deps warnings This PR fixes exhaustive deps warnings for React hooks flagged by the React hooks ESLint plugin. --- .eslintrc | 8 ++++---- .../patient-queue-header.component.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.eslintrc b/.eslintrc index c02ed2095..8ab6c1327 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,8 +11,6 @@ "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint", "import", "jest-dom", "react-hooks", "testing-library"], "rules": { - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn", // Disabling these rules for now just to keep the diff small. We'll enable them one by one as we go. "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-types": "off", @@ -33,7 +31,6 @@ } ], "import/no-duplicates": "error", - "prefer-const": "off", "no-console": [ "error", { @@ -70,7 +67,10 @@ } ] } - ] + ], + "prefer-const": "off", + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn" }, "overrides": [ { diff --git a/packages/esm-service-queues-app/src/patient-queue-header/patient-queue-header.component.tsx b/packages/esm-service-queues-app/src/patient-queue-header/patient-queue-header.component.tsx index 8b2f98b43..3f40d2cdb 100644 --- a/packages/esm-service-queues-app/src/patient-queue-header/patient-queue-header.component.tsx +++ b/packages/esm-service-queues-app/src/patient-queue-header/patient-queue-header.component.tsx @@ -59,11 +59,13 @@ const PatientQueueHeader: React.FC = ({ title, showLoca } } }, [ - queueLocations, currentQueueLocationName, currentQueueLocationUuid, - isLoading, error, + handleQueueLocationChange, + isLoading, + queueLocations, + userSession?.sessionLocation?.display, userSession?.sessionLocation?.uuid, handleQueueLocationChange, userSession?.sessionLocation?.display,