I have been stuck for hours to figure out how to add classActive on the parent html tag of the provided reactrouter tag. Here is the code, Using React-Router "version": "3.2.6"
<li className="sidebar-item">
<div className="sidebar-link" activeClassName="active">
<span>Track Page</span>
<div className="collapse first-level">
<Link className="first-level__link" to="/track-page" activeClassName="active">
Track Page 1
</Link>
<Link className="first-level__link" to="/track-page-2" activeClassName="active">
Track Page 2
</Link>
</div>
</div>
</li>
Currently the active class can only be kept on <link> tag but I need it to be on the <li> the parent of the <link>. How can I achieve this ? Please help.
I am not very familiar with react so, any help here would be much appreciated. Thank you in advance.