Links that ignore basePath?
See original GitHub issueThank you for creating Raviger, it is really close to the routing lib I was considering making out of frustrations with the existing ones! I really like the “cascading routes” concept that allows me to extract, say, a tab-bar and its contents into a component and have it not care about which base route it sits on.
That said, there are times where I want to ignore the basePath
and link to something outside the scope of the closest useRoutes
context. I am currently solving that with relative links that go through parents (i.e. ../../account
), but that is now another way of coupling the specific path to my component. I tried overriding basePath
with '/'
, ''
and null
which doesn’t work (strips away the hostname and everything, or does nothing). Am I missing something fundamental, or should we consider adding an isAbsolute
or similar property to Link
?
EDIT: I should add that I am happy to make a PR for this if you agree.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
https://codesandbox.io/s/loving-joliot-0lvb8?file=/src/App.js
If you click on the “Deep Root” link, and then on the “About” link under that, you will see the
DeepAbout
component render two links to contact, one that is inside the deep root (which is correct), and one that attempts to link to the outer contact url. The second one is broken.@kristiandupont Running the repro you provided if you go to filters and play with the stuff there you will see query strings that dont cause routing to fail, and no wildcard is used for that route.
Think you might have another issue for 1️⃣