brohlson / gatsby-plugin-anchor-links

⚓ Gatsby plugin for using smooth scroll anchor links with a Gatsby Link component
https://www.npmjs.com/package/gatsby-plugin-anchor-links
MIT License
68 stars 22 forks source link

Giving "active" class to a link when location matches link path? #35

Closed Mites-G closed 3 years ago

Mites-G commented 3 years ago

Has anyone tried this? A google search gives nothing.

Hahlh commented 3 years ago

I haven't, but if I would, I would first look at the props that I can pass through to Gatsby Link, especially GatsbyLinkProps.

brohlson commented 3 years ago

Unless GatsbyLink supports this - you'd have to write your own className logic for this.