Active link with React-Router?

Posted by Jessica Taylor | Updated on

Active link with React-Router? no longer has the activeClassName or activeStyle properties. In react-router v4 you have to use if you want to do conditional styling:

I added an exact property to the home , I’m fairly sure that without it, the home link would always be active since / would match /about and any other pages you have.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers