I have Sidebar component with Links, and i need to change Link color when specific URL is opened.
What is best solution of this in React?
I have Sidebar component with Links, and i need to change Link color when specific URL is opened.
What is best solution of this in React?
You could use NavLink component and provide your class as value of activeClassName prop :
<NavLink to="/faq" activeClassName="selected">
FAQs
</NavLink>
CSS rule could be like :
.selected{
color: blue
}