Given URL http://localhost:3000/?team=Video%20QA%20&%20Test%20Team&teamCode=XXXXX while decoded used URLSearchParams is represented as {"team":"Video QA "," Test Team":"","teamCode":"XXXXX"} which is wrong.
How to handle & symbol in query string to get from exampled URL this look:
{"team":"Video QA & Test Team","teamCode":"XXXXX"}
const searchParams = Object.fromEntries(new URLSearchParams(window.location.search).entries());
or tryed query-string lib, same. & symbol recognized as new object key
qs.parse('http://localhost:3000/?team=Video%20QA%20&%20Test%20Team&teamCode=XXXXX')
>Solution :
& should be encoded as %26
console.log(encodeURIComponent('Video QA & Test Team'))
Video%20QA%20%26%20Test%20Team