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

useBasename results in empty location when matches exactly #68

Closed
jesenko opened this issue Sep 25, 2015 · 0 comments
Closed

useBasename results in empty location when matches exactly #68

jesenko opened this issue Sep 25, 2015 · 0 comments

Comments

@jesenko
Copy link
Contributor

jesenko commented Sep 25, 2015

When using useBasename together with react-router, initial location that matches basename exactly results in location='' which cannot be matched by react-router to any route. E.g:

<Route component={App}>
  <Route path="/" component={MyComponent} />
</Route>
...
const history = useBasename(createBrowserHistory)({
  basename: '/basename'
});

Entering URL /basename in browser address bar results in
Warning: Location "" did not match any routes

Not sure whether issue is with react-router not matching empty location "/" or with useBasename, mishandling this specific case... Problem can be fixed on useBasename side by simply replacing empty pathname with /

jesenko added a commit to jesenko/history that referenced this issue Sep 25, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 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

No branches or pull requests

2 participants