Nextjs Link issue
Answered
Crazy ant posted this in #help-forum
Crazy antOP
I have a link tag as below which gives me a url like :
I am getting %7D with username.
my code is as below. I have consoled the userName which displayed "robin" without any space.
How to resolve this issue.
/profile/robin%7d/6CL37uSuMI am getting %7D with username.
my code is as below. I have consoled the userName which displayed "robin" without any space.
<Link href={/profile/${userName}/${userId}}>
View
</Link>How to resolve this issue.
Answered by Giant panda
try encoding your username
const encodedUserName = encodeURIComponent(userName);2 Replies
Giant panda
try encoding your username
const encodedUserName = encodeURIComponent(userName);Answer
Crazy antOP
@Giant panda Thank you so much for your help. Issue is resolved after I used encodeURIComponent.