Skip to content

Fix basePath handling in useInterceptLinkClicks#43

Open
jacobrobertsbaca wants to merge 1 commit intoLayerXcom:mainfrom
cs198:main
Open

Fix basePath handling in useInterceptLinkClicks#43
jacobrobertsbaca wants to merge 1 commit intoLayerXcom:mainfrom
cs198:main

Conversation

@jacobrobertsbaca
Copy link

This PR fixes the basePath handling mentioned in #41 where the App router link interceptor adds the basePath twice.

Unfortunately, the NextJS app router no longer makes basePath accessible (see this page) so removing the extra path segments is not as simple as using router.basePath. Instead, we need to render a node and see what the resulting <a /> tag's href attribute looks like.

I have tested this on my own local site with 1) no base path set and 2) a base path set. Both methods are working.

@rmayenburg1982
Copy link

when will this fix be released?

@frndhoon
Copy link

Hi @jacobrobertsbaca and @ypresto,

Just wanted to follow up on this PR — is there any update on its status?

We’re currently blocked from using this library in production due to the basePath issue in the App Router, so we’re really hoping this fix can be merged.

Please let us know if any additional changes or testing would help move this forward.

Thanks for your work on this!

@leppaott
Copy link

Seems to work when adding as a patch 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants