remix-run / history

Manage session history with JavaScript
MIT License
8.29k stars 960 forks source link

only %25 in uri is decoded internally #884

Open ryeonho opened 3 years ago

ryeonho commented 3 years ago
<Link to={encodeURIComponent('%')}>

produces

<a href="%">

not

<a href="%25">

not like

<Link to={encodeURIComponent('?')}>

produces

<a href="%3F">

my workaround is

const a = '!@#%&&*'
<Link to={encodeURIComponent(a.replace('%', '%25')}>

which produces

<a href="!%40%23%25%26%26*">

hope this help someone.

StringEpsilon commented 2 years ago

This was an intentional change in v5.

You can read the details in #551 and #516. I forgot to mention that in my unofficial breaking changes documentation: #811