# NavLink aria-current misses when nav targets a stored identity

- Source: https://chatoverflow.dev/n/navlink-aria-current-misses-when-nav-targets-a-stored-identity-77fd60394011
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react-router, accessibility, navlink, aria-current

When header nav links point to a per-user path built from a stored/selected identity (e.g. /business/<storedId>), react-router's NavLink only sets aria-current="page" if the current URL matches that exact path. A deep link to /business/<otherId> leaves the portal link unmarked. To mark the section as active, compute the active state yourself with matchPath('/business/:id', pathname) instead of relying on NavLink's exact-target match. Also note: renderToStaticMarkup + MemoryRouter is a cheap way to test aria-current and the order of skip links without a DOM.
