Correcting active link detection

This commit is contained in:
James Barnsley
2020-04-07 11:31:14 +12:00
parent ea5291bd26
commit a1796e668e

View File

@ -45,7 +45,7 @@ export default ({
// they're otherwise identical
const link = decodeURIComponent(to);
const currentLink = decodeURIComponent(history.location.pathname);
const isLinkActive = (exact && currentLink === link) || currentLink.startsWith(link);
const isLinkActive = exact ? currentLink === link : currentLink.startsWith(link);
// We have an active detector method
// This is used almost solely by the Sidebar navigation