Closed
Description
What version of React Router are you using?
6.4.2
Steps to Reproduce
- Create a data router with one route configured with this path:
/contact/:id
- In that route's element, render a relative="path" NavLink:
<NavLink relative="path" to="../1" className={({ isActive }) => isActive ? "active" : undefined} >Michael</NavLink>
- In your browser, go to the following URL:
/contact/1
Expected Behavior
The generated DOM element should contain the active class: <a href="/contact/1" class="active">Michael</a>
Actual Behavior
The generated DOM element has the right href
but doesn't contain the active class: <a href="/contact/1">Michael</a>
, so the expected styles aren't applied.