Skip to content

Commit

Permalink
fix(docz-theme-default): toggle active links on location change (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
lettertwo authored and pedronauck committed Mar 12, 2019
1 parent c694bdf commit 1274b97
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const SmallLink: SFC<SmallLinkProps> = ({
useEffect(() => {
const currentHash = location.hash && location.hash.slice(1, Infinity)
setActive(Boolean(slug === currentHash))
}, [])
}, [location])

return <Link as={Component} {...props} className={isActive ? 'active' : ''} />
}

0 comments on commit 1274b97

Please sign in to comment.