Skip to content
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

useHref passed to RouterProvider not respected for synthetic links #6347

Open
joshuajaco opened this issue May 8, 2024 · 0 comments · May be fixed by #6346
Open

useHref passed to RouterProvider not respected for synthetic links #6347

joshuajaco opened this issue May 8, 2024 · 0 comments · May be fixed by #6346

Comments

@joshuajaco
Copy link
Contributor

joshuajaco commented May 8, 2024

Provide a general summary of the issue here

The useHref function passed to RouterProvider is not being called for synthetic links.
In our Next.js app this results in the data-href attribute missing the base path. Meaning when using CMD + left click to open the link in a new tab the URL is missing the base path.

Looks like it was forgotten in #5864

🤔 Expected Behavior?

The base path is prepended to the data-href attribute

😯 Current Behavior

Using CMD + left click to open a synthetic link in a new tab results in an invalid URL.

💁 Possible Solution

Use useHref when setting the data-href attribute.

🔦 Context

No response

🖥️ Steps to Reproduce

  1. visit https://codesandbox.io/p/sandbox/gallant-currying-l8p7xc?file=%2Fsrc%2FApp.js
  2. CMD + left click to open the link in a new tab
  3. see that the base path is missing

Version

[email protected]

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

If other, please specify.

No response

What operating system are you using?

MacOS, Windows

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@joshuajaco joshuajaco linked a pull request May 8, 2024 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant