I am looking to understand how I can manage the className of a Navlink in React so that when the current path is X, the NavLink has the active class. In the past, I have accomplished this using Laravel and simple bootstrap, but I am unsure of how to achieve the same result with React and Reactstrap.
Example in Laravel:
<a href="{!!URL::to('link1')!!}" class="{{Request::is('link1') ? 'activeMenu' : '' }} >Link1</a>
My code in ReactJS:
<Nav className="navbar-logged">
<NavItem>
<NavLink className="nav-link-gdc" href="/">HOME</NavLink>
<NavLink className="nav-link-gdc" href="#">LINK1</NavLink>
<NavLink className="nav-link-gdc" href="#">LINK2</NavLink>
<NavLink className="nav-link-gdc" href="#">LINK3</NavLink>
<NavLink className="nav-link-gdc" href="#">LINK4</NavLink>
</NavItem>
</Nav>