-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Link has 'exact' as a prop? #7526
Comments
The readme refers to Gatsby v1. Are you using v1 or v2? |
Oh, sorry that I wasn't clear enough. I was using v2. |
V2 is now using reach-router and as such, However you should be able to accomplish what you're after by using reach-router's From reach-router's documentation: // this link will be active when itself or deeper routes
// are current
const isPartiallyActive = ({
isPartiallyCurrent
}) => {
return isPartiallyCurrent
? { className: "active" }
: null
}
const PartialNavLink = props => (
<Link getProps={isPartiallyActive} {...props} />
) Also relevant: https://next.gatsbyjs.org/docs/migrating-from-v1-to-v2/#the-following-props-are-no-longer-available-on-link |
Thank you!! |
I wonder the following words on the readme page from npmjs.org is still true:
A bit of a background, what I'd like to do is to build a navbar. Let's say I have:
"/", "/about", "/blogs"
as 3 pages in the app. And if I hit "localhost:8000/blogs", the "/blogs" Links is assigned an "active" attribute. However, if I navigate to a single blog post like "localhost:8000/blogs/what-is-going-on/", then the "/blogs" Link is not "active", which is not an ideal situation.
The text was updated successfully, but these errors were encountered: