Skip to content

Commit

Permalink
Remove conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliteg committed Aug 27, 2024
1 parent 96e984e commit 49e7f52
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ const NavLink: FC<NavLinkProps> = ({ href, label }) => {
const normalizedPathname = removeTrailingSlash(pathname);
const normalizedHref = removeTrailingSlash(getPath(href));

if (normalizedHref === "/") {
setIsActive(normalizedPathname === "/");
} else {
setIsActive(normalizedPathname === normalizedHref);
}
setIsActive(normalizedPathname === normalizedHref);
}, [pathname, href]);
return (
<li className="relative">
Expand Down

0 comments on commit 49e7f52

Please sign in to comment.