question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using `base` and `hashRouter` produces weird URLs

See original GitHub issue

Bug Report

When you set a different base and use the hashRouter you get weird duplication of URLs.

For example you set base to /foo and then go to your deployed doc site and click around

you’ll end up with something like /foo/#/foo/<sub>/<sub>/

Expected behavior

The base isn’t appended on every URL on top of itself

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
pedronauckcommented, Sep 2, 2018

For sure, thanks guy! The basename on router, in this case, is used to bind Link component, but I think that isn’t necessary since webpack public path is setted, I’ll remove basename from router and release in the next release 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comparing the HashRouter and the BrowserRouter in React ...
We can determine what page the user sees based on the visited URL in a web application with routes. There is more than...
Read more >
ReactJS with React Router - strange routing behaviour on ...
The problem is that Chrome try to send a get request, and appends a ? to your current URL, because you don't have...
Read more >
Using Hashed vs. Non-Hashed URL Paths in Single Page Apps
When it comes to Hashed URLs, the main disadvantage is its appearance. Some users might consider it to be unusual. Not the best...
Read more >
hashRouter is prepending my links with "#" : r/reactjs - Reddit
Ah, I understand. Using Cordova isn't my default assumption. It's quite possible that Cordova has some weird internal urls that browser router ...
Read more >
Using Hashrouter With React - Definitive Guide | Upbeat Code
And it makes it a great candidate for single-page applications. Using Hash Router in React. Now that we know the role of #...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found