Next.js Discord

Discord Forum

external links in next/link or better a href ?

Answered
Sweat bee posted this in #help-forum
Open in Discord
Sweat beeOP
hey, I am curious... should I use next/link of a href for external links? Can it lead to issues when using next/link? Fouund a stackoveflow from 2020 where it could cause a problem!
Answered by Plott Hound
I regularly use Link for external links and never had a problem. Do you have a link to the stack exchange post so I can check?
View full answer

19 Replies

Plott Hound
I regularly use Link for external links and never had a problem. Do you have a link to the stack exchange post so I can check?
Answer
its quite old so I dont know if this issue still persists
Plott Hound
this is 3 years ago. using Link for exernal links is fine
Sweat beeOP
ok
but what is about target blank?
is this supported?
Plott Hound
yes!
Bighead carp
Yep
Plott Hound
all the usual <a> paramters are supported
Sweat beeOP
and what about that next/link is prefetching the url, I think I just disable that feature if link is external?
Plott Hound
you dont need to disable it, it wont prefetch external links
Sweat beeOP
ah ok
Plott Hound
there are more specifics here if you need to reference https://nextjs.org/docs/app/api-reference/components/link
Sweat beeOP
ok cool thanks
Plott Hound
could you mark my reply as the answer please?
Original message was deleted
Plott Hound
this is how
thanks