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

Support relative links #511

Open
maxsalven opened this issue Feb 21, 2025 · 1 comment
Open

Support relative links #511

maxsalven opened this issue Feb 21, 2025 · 1 comment

Comments

@maxsalven
Copy link

Would love to see support for relative links in Wouter!

URL: https://www.example.com/some/long/unnested/route/foo

<Link to="../bar">Takes you to example.com/some/long/unnested/route/bar</Link>

I appreciate we can nest things but that's not always an appropriate option.

@molefrog
Copy link
Owner

It's not something we have in the roadmap, but maybe this can be solved with a custom wrapper around Link component e.g.

// under the hood, takes current location from `useLocation`, resolves the absolute path and renders a regular Link
<RelLink to="../bar" />

If you get it working, please let me know, maybe we can add this to the README.

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

No branches or pull requests

2 participants