Skip to content

Commit

Permalink
Fixed parent link active issue remix-run#10506
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilal Kazmi committed Jul 24, 2023
1 parent 904422a commit 6338870
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-router-dom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ export const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(
locationPathname === toPathname ||
(!end &&
locationPathname.startsWith(toPathname) &&
locationPathname.charAt(toPathname.length - 1) === "/");
(locationPathname.charAt(toPathname.length - 1) === "/" || locationPathname.charAt(toPathname.length) === "/")
);

let isPending =
nextLocationPathname != null &&
Expand Down

0 comments on commit 6338870

Please sign in to comment.