Next.js Discord

Discord Forum

NextJs 12.2 Are we supposed to be see <a> tag when "Inspect"ing on Browser for a <Link> tag used?

Unanswered
Harris's Hawk posted this in #help-forum
Open in Discord
Harris's HawkOP
NextJs 12.2 Are we supposed to be see <a> tag when "Inspect"ing on Browser for a <Link> tag used in nextJs code? I ask this coz I do not see one. I am trying to understand if this is expected? If so, whats the best way to get <A> tag while inspecting? I need it for SEO related.

5 Replies

@Harris's Hawk NextJs 12.2 Are we supposed to be see <a> tag when "Inspect"ing on Browser for a <Link> tag used in nextJs code? I ask this coz I do not see one. I am trying to understand if this is expected? If so, whats the best way to get <A> tag while inspecting? I need it for SEO related.
Are we supposed to be see <a> tag when "Inspect"ing on Browser for a <Link> tag used in nextJs code?
yes
I am trying to understand if this is expected?
no it isn't and probably due to a bug in your code
Harris's HawkOP
Cool, thank you for the guidance.
@Harris's Hawk I think the legacy behavior of next/link is to require a nested a tag, this only got changed on v13 which doesn't require it anymore. so if you are not rendering one in your JSX it seems expected to me to not be in the HTML
Harris's HawkOP
Gotcha, cool. Thank you for the help. Yes, I am using nextJs 12.2 and I didnt add <A> tag inside <Link> tag
Will try again after adding <a> tag inside <Link> tag