T
TanStack13mo ago
unwilling-turquoise

@ in param

If I do something like this
<Link to="/$profile" params={{ profile: `@user` }>Name</Link>
<Link to="/$profile" params={{ profile: `@user` }>Name</Link>
the element is being formed as
<a href="/%40user">Name</a>
<a href="/%40user">Name</a>
How it can be fixed?
11 Replies
unwilling-turquoise
unwilling-turquoiseOP13mo ago
On navigating by this link, the browser's address bar also displays not @user, but %40user
other-emerald
other-emerald13mo ago
@Sean Cassiere I think you were involved in uri component encoding decoding, right?
unwilling-turquoise
unwilling-turquoiseOP13mo ago
Link is a component from tanstack router
rising-crimson
rising-crimson13mo ago
Yea, this got changed so all path params got decoded. Because of the conflicts between their font view vs Unicode view.
other-emerald
other-emerald13mo ago
whats that conflict about?
rising-crimson
rising-crimson13mo ago
URL matching fails. For example, matching an emoji vs the Unicode version of the same emoji would cause route matching to fail. Not at my computer right now, but we had a closed issue on it
other-emerald
other-emerald13mo ago
should we make this configurable? so by default, decode everything, but if user wants to provide his own logic (that may then exclude certain chars) he can?
rising-crimson
rising-crimson13mo ago
🤷🏼‍♂️ Haven't thought too much into it to be honest. Yea maybe a strict: true kind of situation is what you mean yes? Or allow the user to pass in a function? Just keep in mind the whole configuration surface thingy 😅
other-emerald
other-emerald13mo ago
Or allow the user to pass in a function?
that's what I meant
Just keep in mind the whole configuration surface thingy 😅
absolutely, but in this case I think we don't know better than the user
rising-crimson
rising-crimson13mo ago
👍🏼
unwilling-turquoise
unwilling-turquoiseOP13mo ago
Why can't we apply decoding at the time of matching (both for the url and for the passed parameters) and keep them original the rest of the time?

Did you find this page helpful?