Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Router 4 Basics Navigating, Nesting and Redirecting Routes Navigating and Nesting Routes Review

Which component lets you add styling to a link when it matches the current URL.

maybe my understanding is incorrect, but doesn't the <Route> component allow you to add a styling through the component prop?

1 Answer

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

Hi cloud712 , to get the 'active' link styling, use NavLink instead of Link from react-router-dom. That will add an 'active' className to active links. So you can go into the CSS and create a rule for the .active class and give it some custom styling. Here's the video that demos this. :thumbsup: