Next.js Discord

Discord Forum

Dynamic href

Answered
Siamese posted this in #help-forum
Open in Discord
SiameseOP
How can I do something like /dashboard/${guildid}/... if this now is broken?
https://nextjs.org/docs/messages/app-dir-dynamic-href
Answered by Siamese
I modified nextra get page map and added "/docs" to it
View full answer

13 Replies

SiameseOP
Cause it only seems to accept hardcoded paths
@Siamese How can I do something like `/dashboard/${guildid}/...` if this now is broken? https://nextjs.org/docs/messages/app-dir-dynamic-href
yea, in the link that you shared is already the solution (see attached). Build this "dynamic route" yourself. It should be easy to do the following:
+<Link href={`/dashboard/${guildid}/`}>Some Ref</Link>
Im trying to move to encodeURIComponent
@Siamese the problem is, I have all links like this and it does not work
can you share your folder structure and your package.json? Also please share a screenshot of the code as example, so we better understand you
SiameseOP
im not sure where exactly is the error coming from but the url it gives me, I don't use the one with param stuff
try to comment out specific parts of your app, to see where the error comes from. It should be from a "Link" component
@B33fb0n3 try to comment out specific parts of your app, to see where the error comes from. It should be from a "Link" component
SiameseOP
i always used the /dashboard/${guildid}/... and yet it errors. I don't have the style that docs show
SiameseOP
I will once im done trying the encode stuff
SiameseOP
Btw i somehow fixed it
@Siamese Btw i somehow fixed it
Please share what you did, so others that encounter this issue, can solve it as well
@B33fb0n3 Please share what you did, so others that encounter this issue, can solve it as well
SiameseOP
I modified nextra get page map and added "/docs" to it
Answer