Is there any way to overcome history.push auto decoding by react-router?

Viewed 217

I'm using history.push by react router to manipulate with URL and facing an issue with auto decoding. What I'm trying to achieve - is the URL properly encoded without encoding slashes, question marks, but with encoding of ",[,] and other characters. For that purpose, I use the encodeURI function, it encodes the URL properly, but then history.push automatically decodes it before changing the browser line. Is there any way to overcome it?

Versions:

  • "react-router": "^5.2.0",
  • "react-router-dom": "^5.2.0",
  • "react": "16.13.1",
  • "history": "^5.0.0",
0 Answers
Related