Hi,
I just updated to the beta of react-router v4. I found out about the NavLink component by looking at the code, it's not present in the documentation.
It works quite well, except when I want to use it in a navbar for nested routes, because the NavLink apply the active class if the url match partially and not exactly, it leads to multiple NavLink in my navbar having the active class at the same time.
What do you think about adding a prop to control this behavior ?
Thanks !
I found out about the NavLink component by looking at the code, it's not present in the documentation.
:( Sorry about that. We've done a ton of work on the docs, but there's still a ton to do. Also please keep in mind this is still a beta release.
On the bright side, you probably caught a glimpse of how easy it is to compose <Route> and <Link> together to create <NavLink> by looking through the source ;)
But you're right, <NavLink> should probably have both exact and strict props, just like <Route> does, to expose the full variety of matching options.
Thanks for your reactivity ! The work on documentation is amazing ;)
Most helpful comment
Thanks for your reactivity ! The work on documentation is amazing ;)