TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

In Memory Router requires links be pressed multiple times after history.back() is called #1555

Closed DNR500 closed 2 weeks ago

DNR500 commented 2 weeks ago

Describe the bug

When using an in memory router called history.back() seems to have an impact on clicking links - after history.back() is called Links sometimes seem to require two clicks before routing to a new page

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-in-memory-njf6lw

Steps to Reproduce the Bug or Issue

  1. Click on the "Component About" link
  2. Then click on the back button that appears
  3. Then click on the "Component About" link again
  4. After this changing the displayed route by clicking either "Component Home" or "Component About" requires more than one click

Expected behavior

Behaves as expected for the standard router

https://stackblitz.com/edit/tanstack-router-in-browser-njf6lw-wyq9aw

  1. Click on the "Component About" link
  2. Then click on the back button that appears
  3. Then click on the "Component About" link again
  4. After this changing the displayed route by clicking either "Component Home" or "Component About" requires only one click

Screenshots or Videos

No response

Platform

OS: macOS 13.3.1 (22E261) Browser: Chrome Version 123.0.6312.59 (Official Build) (arm64) Version: @tanstack/react-router: ^1.31.8

Additional context

No response