Using `base` and `hashRouter` produces weird URLs
See original GitHub issueBug 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:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Problem is that
base
is used forhttps://github.com/pedronauck/docz/blob/dee78a71fa6c9fc0da893be413034798f10f756c/packages/docz-core/src/bundlers/webpack/config.ts#L49
https://github.com/pedronauck/docz/blob/dee78a71fa6c9fc0da893be413034798f10f756c/packages/docz-core/src/bundlers/webpack/config.ts#L87
https://github.com/pedronauck/docz/blob/dee78a71fa6c9fc0da893be413034798f10f756c/packages/docz-core/src/bundlers/webpack/config.ts#L238
and
https://github.com/pedronauck/docz/blob/7a84638aa140888b0102885372bcacb9c797c395/packages/docz/src/theme.tsx#L50
And this should be a 2 different options (like
base
androuterBase
).Demo: http://johngrish.in/components/#/components/box
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 removebasename
from router and release in the next release 🙏