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
Incorrect Link href with basepath #76
Comments
@giuem Oh yeah, that's a bummer. You're right since wouter is based on simple |
Another idea is to introduce a new prop on const linkPropsTo = (path) => ({
href: path,
originalHref: basePath + path
})
<Link {...linkPropsTo("/users")} /> Just an idea. |
function createLink(basepath = '') {
function Link(props) {
// ...
const href = props.href || props.to;
const originalHref = basepath + href;
// ...
}
return Link;
}
const Link = createLink(basepath);
<Link href="/users" /> |
@omgovich Not yet, there are a few things left:
I also haven't decided yet which name to use. Been thinking that <Router base="/app">...</Router> |
@molefrog I can rename |
i agree!!!! good idea!! 😄 |
Look great for me! Can't wait to use. |
@omgovich Types have been landed in |
@molefrog Sure) |
The basepath support has just landed in the latest |
Hello, I'm trying to implement basepath into my application. I followed the README's instruction. Everything works well, except
<Link />
component.For example,
It's fine that clicking on it will navigate to
:basepath/path
, but the href prop is still/path
.Now I had to use
<Link />
in this way,Any idea on it?
The text was updated successfully, but these errors were encountered: