Skip to content

Commit

Permalink
fix: escape path in isCurrent check
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst authored and ryanflorence committed Sep 5, 2019
1 parent 3958c4e commit 137a1ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -402,8 +402,9 @@ let Link = forwardRef(({ innerRef, ...props }, ref) => (
{({ location, navigate }) => {
let { to, state, replace, getProps = k, ...anchorProps } = props;
let href = resolve(to, baseuri);
let isCurrent = location.pathname === href;
let isPartiallyCurrent = startsWith(location.pathname, href);
let encodedHref = encodeURI(href)
let isCurrent = location.pathname === encodedHref;
let isPartiallyCurrent = startsWith(location.pathname, encodedHref);

return (
<a
Expand Down

0 comments on commit 137a1ae

Please sign in to comment.