Skip to content

Commit

Permalink
fix: wrap func in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWu098 committed May 21, 2024
1 parent 4b8d858 commit 6ad835d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/components/Nav/Nav.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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 <></>;
Expand Down

0 comments on commit 6ad835d

Please sign in to comment.