-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
I have the following route:
path: '/article/:title--:id.html',
This is my params
{ id: 10 , title: '-50% on nutella' }
It fail to encode the percent, or it fail to decode if I encode it myself the title with encoreURIComponent
or encoreURI
Version
- react-router 5.1.2
- react-router-dom 5.1.2
Steps to reproduce
Use history.push(page, { id: 1, title: '-50%' })
- Notice that it fail to encode
Use history.push(page, { id: 1, title: encodeURIComponent('-50%') })
-
Notice that it now work
-
Press
F5
, notice that it can't decode -
Notice that it fail to encode
Expected Behavior
I expect RR to be able to encode and decode any characters
Actual Behavior
It fail to encode the %
URIError: Pathname "/article/-50%--13.html" could not be decoded. This is likely caused by an invalid percent-encoding.
at createLocation (history.js:87)
With encodeURIComponent(title)
, on refresh (F5)
But then a decode does: URIError: Failed to decode param '/article/-50%--14.html'
at decodeURIComponent (<anonymous>)
Metadata
Metadata
Assignees
Labels
No labels