router
router copied to clipboard
Path params are not UrlEncoded
Describe the bug
If a path param has a character that gets urlEncoded (i.e. a , %, etc.), the page works fine on initial load, but upon refreshing, the path is not decoded (I think)
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-p58qkk?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
- Go to Posts
- Go to any post
- Refresh the page
Expected behavior
The page reloads with no difference
Screenshots or Videos
What actually happens:
Platform
- OS: [Linux]
- Browser: [Chrome, and Firefox]
- Version: [1.5.2]
Additional context
The changes to the app from the demo are
- .then((r) => r.data.slice(0, 10))
-}
+ .then((r) =>
+ r.data.slice(0, 10).map((it) => ({ ...it, id: `${it.id} ${it.id}` }))
+ );
+};
- .get<PostType>(`https://jsonplaceholder.typicode.com/posts/${postId}`)
+ .get<PostType>(
+ `https://jsonplaceholder.typicode.com/posts/${postId.split(' ')[0]}`
+ )