I am using AniLink to transition between pages. However, my site also includes anchor links, for these anchor links I have a custom getProps function that is passed to then to update the activeClassName based on the hash field in the location object. I have noted that when I use AniLink for my links, say for example /#contact the address bar in the browser does not update unless the previous address was on a different pathname, for example /blog, still in that case the address bar updates to / only. I have been digging through AniLinks source code, and it uses Link component from gatsby internally, which works perfectly. I thought this being the case AniLink would update the location object as required and also handle getProps since my classes are also not being updated.
I am using
AniLink
to transition between pages. However, my site also includes anchor links, for these anchor links I have a customgetProps
function that is passed to then to update theactiveClassName
based on thehash
field in thelocation
object. I have noted that when I useAniLink
for my links, say for example/#contact
the address bar in the browser does not update unless the previous address was on a differentpathname
, for example/blog
, still in that case the address bar updates to/
only. I have been digging throughAniLink
s source code, and it usesLink
component from gatsby internally, which works perfectly. I thought this being the caseAniLink
would update the location object as required and also handlegetProps
since my classes are also not being updated.