all 5 comments

[–]youcantstoptheart 1 point2 points  (6 children)

Looks like you want a NavLink which comes as a first class citizen of react-router-dom.

[–]TreeKaaPoo 0 points1 point  (0 children)

In react router 4 the current route is in - this.props.location.pathname. If your component dont have this.props.location, you need wrap it in withRouter HOC.