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

Open in new tab doesn't work with hash router #300

Closed
ronaldruzicka opened this issue Jul 26, 2022 · 1 comment
Closed

Open in new tab doesn't work with hash router #300

ronaldruzicka opened this issue Jul 26, 2022 · 1 comment

Comments

@ronaldruzicka
Copy link

Describe the bug

When using hash router there are couple of bugs.

  1. cmd+click which opens a link in a new tab doesn't work properly
  1. When you modify the url in the browser, it doesn't redirect to that url, only after a refresh
  • it correctly shows an active link but the content doesn't change, only after refresh

Your Example Website or App

https://codesandbox.io/s/react-location-basic-with-hash-forked-wqxkpn

Steps to Reproduce the Bug or Issue

  1. Open sandbox
  2. cmd + click on posts link in the navigation, it opens in another tab
  3. It should already have a # sign after posts but it doesn't
  4. Clear the url of the # and click again on a post navigation link
  5. url should be correct /#/posts
  6. cmd + click on post 1, it should open on another tab
  7. url should be /#/posts/1, but is instead /posts/1, it loses the #`
  8. Go back to /#/posts/1 url and manually change it to the second post /#/posts/2
  9. The content sometimes changes on first change, but on another one it doesn't, but the active link does (getActiveProps makes it bold)

Expected behavior

  1. Opening url on a new tab should keep the # in the url, when using hash router
  2. Manually changing the url should open given page without the need for refresh
  3. Both cases are working in react-router, it would be great if it worked in react-location as well

Screenshots or Videos

Screen.Recording.2022-07-26.at.08.18.46.mov

Platform

  • OS: macOS, Windows, Linux
  • Browser: Chrome, Safari, Firefox
  • Version: latest

Additional context

No response

@tannerlinsley
Copy link
Collaborator

Should be fixed in TanStack Router

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants