Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path params are not UrlEncoded #1012

Closed
JadenSHoward opened this issue Jan 17, 2024 · 0 comments
Closed

Path params are not UrlEncoded #1012

JadenSHoward opened this issue Jan 17, 2024 · 0 comments

Comments

@JadenSHoward
Copy link

JadenSHoward commented Jan 17, 2024

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

  1. Go to Posts
  2. Go to any post
  3. Refresh the page

Expected behavior

The page reloads with no difference

Screenshots or Videos

What actually happens:

image

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]}`
+    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant