Closed patelvivekdev closed 2 months ago
Use the <a>
tag in Next.js when linking to external URLs or when you need to include attributes like target="_blank"
. The <Link>
component is used for internal navigation within the app to benefit from client-side routing and performance optimizations.
^ Exactly!
Thanks for the explanation! I noticed in the Next.js docs that attributes like className and target="_blank" can be passed directly to the component and applied to the underlying tag. Is it still a better choice to use over for external URLs?
https://nextjs.org/docs/app/api-reference/components/link#reference
In app/page.tsx