diff --git a/src/app/components/Nav/Nav.js b/src/app/components/Nav/Nav.js index 5b5212d3..fb579c75 100644 --- a/src/app/components/Nav/Nav.js +++ b/src/app/components/Nav/Nav.js @@ -1,4 +1,4 @@ -import { useState, memo } from "react"; +import { useState, memo, useCallback } from "react"; import { Link, useLocation } from "react-router-dom"; import { Text } from "app/components"; @@ -11,9 +11,9 @@ const Nav = () => { const { pathname } = useLocation(); const [mobileExpand, setMobileExpand] = useState(false); - const toggleMobileExpand = () => { + const toggleMobileExpand = useCallback(() => { setMobileExpand(!mobileExpand); - }; + }, [mobileExpand]); if (pathname === "/designathon22/" || pathname === "/designathon22") return <>;