I am building a Gatsby site and I have the following HTML structure for the website's menu:
<li className="menu-item current-menu-item">
<Link to="/">Home</Link>
</li>
<li className="menu-item">
<Link to="/contact">Contact</Link>
</li>
As you can see, the active class is applied to the <li> tag and not the <a> tag that is generated by <Link>. In Vue, we can do something like this:
<router-link to="/contact" tag="li">
<a href="javascript:void">Contact</a>
</router-link>
The tag prop tells the router-link element that it should render the element as a list item. This way, the active class is applied to the list item and not to the child <a> tag. How do I achieve the same result with Gatsby Link? I can't seem to find an answer to this anywhere. Thank you.