router icon indicating copy to clipboard operation
router copied to clipboard

useSearch params become undefined after waiting some time and hovering on a Link component

Open gabrielbuii opened this issue 1 year ago • 0 comments

Describe the bug

Initially the params from the useSearch are correct. However, if we wait around 30s, I notice that hovering over a Link component or an anchor element with props from the useLinkProps() will change the params to undefined. The latter one is harder to reproduce.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-dmt89j?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Open up the example
  2. You should be on /about?href=something
  3. The console logs out { href:something }
  4. Wait 30 seconds
  5. Hover on the 'About' Link component
  6. The console logs out {} instead of { href:something }

Expected behavior

The query params shouldn't be undefined if they are still in the URL

Screenshots or Videos

https://github.com/TanStack/router/assets/133883077/30448a47-2cc8-41a3-acd5-b11313307fe5

Platform

  • OS: Ubuntu 22.04
  • Browser: Chrome 120.0.6099.199 (Official Build) (64-bit)

Additional context

@tanstack/react-router": "^1.9.0", @tanstack/router-devtools": "^1.9.0", @tanstack/router-vite-plugin": "^1.8.2"

gabrielbuii avatar Jan 25 '24 09:01 gabrielbuii