From ecfa13d940f2a8c924727b91bffd18adae676a94 Mon Sep 17 00:00:00 2001 From: Mike Okoth <65109328+myk4040okothogodo@users.noreply.github.com> Date: Mon, 27 Jun 2022 00:11:19 +0300 Subject: [PATCH] Update Navbar.jsx Line 40:6: React Hook useEffect has a missing dependency: 'setScreenSize'. Either include it or remove the dependency array react-hooks/exhaustive-deps 11:55:49 PM: Line 48:6: React Hook useEffect has a missing dependency: 'setActiveMenu'. Either include it or remove the dependency array react-hooks/exhaustive-deps --- src/components/Navbar.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 1e23d140..e7c75825 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -38,7 +38,7 @@ const Navbar = () => { handleResize(); return () => window.removeEventListener('resize', handleResize); - }, []); + }, [setScreenSize]); useEffect(() => { if (screenSize <= 900) { @@ -46,7 +46,7 @@ const Navbar = () => { } else { setActiveMenu(true); } - }, [screenSize]); + }, [screenSize,setActiveMenu]); const handleActiveMenu = () => setActiveMenu(!activeMenu);