Skip to content

Using NavLink and Accordion, cannot see current active link #1529

Answered by lachlanjc
escapemanuele asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! While I've never used these components in exactly that way, my guess is you'll need to wrap NavLink with Link so you can custom-apply your active styling to it. We don't integrate with Gatsby/Next/etc links out of the box since this is just a styling library. Try making your own GatsbyNavLink component that checks if the link is active with Gatsby, then renders a child NavLink.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@escapemanuele
Comment options

Answer selected by escapemanuele
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1528 on February 25, 2021 15:47.