My goal is to maintain the color of a link when it is clicked. Currently, hovering over the navbar link changes it to greyish, but I want it to remain a different color after clicking on it. I am implementing this using the react-router-dom
library for the Link component.
<nav>
<ul className="nav-wrapper">
<li>
<Link className="link" to="/">
Home
</Link>
</li>
<li>
<Link className="link" to="/gallery">
Gallery
</Link>
</li>
<li>
<Link className="link" to="/about">
About
</Link>
</li>
</ul>
</nav>
I'm unsure about the best approach here - should I use useState to handle the color change upon click, or make the adjustment in CSS? Any suggestions or tips would be greatly appreciated.