From 5caffc63d2c304a10c94c228c0f585e952b847b4 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Sat, 16 Jan 2021 21:44:32 +0200 Subject: [PATCH] Fix few bad hook dependencies --- .eslintrc.json | 1 - src/pages/admin/login.tsx | 2 +- src/views/common/AdminPageWrapper.tsx | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index d931929..38d589e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -64,7 +64,6 @@ "jsx-a11y/label-has-associated-control": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/no-noninteractive-element-interactions": "off", - "react-hooks/exhaustive-deps": "warn", "jsx-a11y/no-static-element-interactions": "off" } } \ No newline at end of file diff --git a/src/pages/admin/login.tsx b/src/pages/admin/login.tsx index 8738a27..346c2dc 100644 --- a/src/pages/admin/login.tsx +++ b/src/pages/admin/login.tsx @@ -26,7 +26,7 @@ const AdminLoginPage: NextPage = () => { router.push(next); } }); - }, []); + }, [router, next]); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); diff --git a/src/views/common/AdminPageWrapper.tsx b/src/views/common/AdminPageWrapper.tsx index 4396273..702c545 100644 --- a/src/views/common/AdminPageWrapper.tsx +++ b/src/views/common/AdminPageWrapper.tsx @@ -48,7 +48,7 @@ const useShouldRedirect = (enabled = true) => { setCompleted(true); }); } - }, []); + }, [enabled]); return { redirecting,