Currently, we are receiving data from an API where the URL is used for navigation within the application. Within our link component, we pass a URL like
<Link href={{ pathname: url , someOtherProperty }} />
, which typically appears as /path-to-page?query=value
. However, when viewing the client, it shows up as /path-to-page%3Fquery=value
. The URL displays correctly when not passing an object to href
using <Link href={url} />
. Additionally, attempts to use decodeURIComponent
on the URL before passing it to pathname
have proven unsuccessful due to its correctness being altered upon rendering.
Any suggestions or solutions would be greatly appreciated!