React Router v4 <NavLink> vs <Link> benefits

yam55 picture yam55 · Nov 16, 2017 · Viewed 71.8k times · Source

Besides the ability to set an "activeClassName" and "activeStyle" on NavLink, is there any reason to use NavLink over Link when creating links to other routes on non-navigational elements (ie. not main nav in header or footer) on your site that don't need an active state/class?

Answer

Abdennour TOUMI picture Abdennour TOUMI · Nov 16, 2017

The official documentation is clear:

<NavLink>

A special version of the <Link> that will add styling attributes to the rendered element when it matches the current URL.

Thus, the answer is NO. There are no other reasons except the mentioned one.