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

[Bug]: react-aria-components Link - wrong href for external links integrating with React Router #11856

Closed
universse opened this issue Jul 31, 2024 · 1 comment
Labels

Comments

@universse
Copy link

What version of React Router are you using?

6.25.1

Steps to Reproduce

Follow https://react-spectrum.adobe.com/react-aria/routing.html.
Here's a reproduction https://stackblitz.com/edit/vitejs-vite-jqjqfr?file=src%2FApp.tsx

Expected Behavior

External link should be kept as is.

Actual Behavior

External link is appended the site origin and basename.

@brophdawg11
Copy link
Contributor

This is not a React Router issue - as it's not our Link component. The React Router Link component handles external links correctly: https://stackblitz.com/edit/vitejs-vite-xradgj?file=src%2FApp.tsx

My hunch is that it's because React Aria is just using useHref directly to generate the href's - and useHref is only for use with links within your React Router app - not for external links.

@brophdawg11 brophdawg11 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants