T
TanStack16mo ago
dependent-tan

@ 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
dependent-tan
dependent-tanOP16mo ago
On navigating by this link, the browser's address bar also displays not @user, but %40user
eastern-cyan
eastern-cyan16mo ago
@Sean Cassiere I think you were involved in uri component encoding decoding, right?
dependent-tan
dependent-tanOP16mo ago
Link is a component from tanstack router
sunny-green
sunny-green15mo ago
Yea, this got changed so all path params got decoded. Because of the conflicts between their font view vs Unicode view.
eastern-cyan
eastern-cyan15mo ago
whats that conflict about?
sunny-green
sunny-green15mo 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
eastern-cyan
eastern-cyan15mo 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?
sunny-green
sunny-green15mo 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 😅
eastern-cyan
eastern-cyan15mo 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
sunny-green
sunny-green15mo ago
👍🏼
dependent-tan
dependent-tanOP15mo 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?