Is there any way to make the last path active in react router v6 using Navlink?

Viewed 11
 <NavLink
    to="/account/user"
    className={({ isActive }) => (isActive ? "active" : "undefined")}
  >
    User
 </NavLink>

So I've been working with react-router v6 and trying to highlight the active link. I've paths like /account/user and /account. When I'm on path /account/user, both account and user nav menu gets the active class. Is there any way to get it only on user menu/ last path?

0 Answers
Related