Skip to content

don't incude a trailing slash in the href for pathname='/' if the basename is not empty #4000

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

Merged

Conversation

jochenberger
Copy link
Contributor

@jochenberger jochenberger commented Oct 6, 2016

I use <Router basename="/foo">. If I call transitionTo('/'), I end up at http://host/foo/ but I expect to land on http://host/foo. I also tried passing {pathname:null} but that doesn't help either.

@ryanflorence
Copy link
Member

Thanks :)

@ryanflorence ryanflorence merged commit 942a568 into remix-run:v4 Oct 6, 2016
@jochenberger jochenberger deleted the transition-to-root-with-basename branch October 7, 2016 04:56
@mmartha
Copy link

mmartha commented Jun 25, 2018

Hi there, currently on react-router 4.2.0 and experiencing the exact same behavior.

<BrowserRouter basename="/foo/bar">
    <Route path="/" component={App}/>
</BrowserRouter>
<Link to="/" />

the link takes me to http://host/foo/bar/ when I expect http://host/foo/bar

@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants