router icon indicating copy to clipboard operation
router copied to clipboard

loader called 2 times when route uses searchParams with quoted values

Open nklhtv opened this issue 1 year ago • 0 comments

Describe the bug

If a route uses validationSearch like: validateSearch: z.object({ token: z.string() }) and you go to a route with ?token="qwe" query, the loader is called 2 times, but if you go to the same route with ?token=qwe query, the loader is called once.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-n3bfz9

Steps to Reproduce the Bug or Issue

  1. Click Go /home?token="qwe" link
  2. Check the logs in the console, Home loader qwe is logged 2 times
  3. Click Go /home?token=qwe link
  4. Check logs in console, Home loader qwe is logged once

Expected behavior

Navigating to Go /home?token="qwe" should trigger loader only once

Screenshots or Videos

No response

Platform

  • OS: mac
  • Browser: Firefox
  • Version: 121

Additional context

No response

nklhtv avatar Jan 16 '24 09:01 nklhtv