Skip to content

Commit

Permalink
feat: listen to activeLink changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timoheddes committed Aug 21, 2023
1 parent f1a1655 commit 325aecc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React, {
FC,
FunctionComponentElement,
HTMLAttributeAnchorTarget,
useEffect,
} from 'react';

export interface INavItem {
Expand All @@ -36,6 +37,10 @@ export const NavHeaderNavigation: FC<INavHeaderNavigationProps> = ({
const { glowX, animationDuration, glowRef, navRef, activeNav, setActiveNav } =
useGlow(activeLink);

useEffect(() => {
if (activeLink) setActiveNav(activeLink);
}, [activeLink]);

return (
<nav className={navWrapperClass} ref={navRef}>
<div
Expand Down

0 comments on commit 325aecc

Please sign in to comment.