August 2017
Beginner
374 pages
10h 41m
English
React-router offers a special version of the <Link> component. It is called <NavLink> and adds styling attributes to the link.
By default, the currently active link is given the active class. The activeClassName property can be used to change that behavior.
Furthermore, the activeStyle property can be used to define a style object for active links. This is what we are going to use in this section:
import { NavLink } from 'react-router-dom'
const activeLink = { textDecoration: 'none', color: 'black'}
Read now
Unlock full access