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
8.28k stars 664 forks source link

The relative routing does not allow updating the path params using the <Link> component. #2801

Open RobertOstermann opened 1 week ago

RobertOstermann commented 1 week ago

Which project does this relate to?

Router

Describe the bug

I am attempting to update only the path params from the current route, but the params are not updating. This seems to work for search params.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-hjja2d?file=src%2Froutes%2Fposts.%24postId.tsx

Steps to Reproduce the Bug or Issue

  1. Go to the stackblitz.
  2. Click on the posts link and select the first post.
  3. There should be a link on that page that says "Switch to post 2"
  4. Attempt to click on the link
  5. Notice the path is not updated

Expected behavior

Path params to get replaced when navigating to '.'.

Screenshots or Videos

No response

Platform

Additional context

This might be related to #2415, but I wasn't sure since that is using navigate instead of a link.