Link Component in NextJS
🔗 Link Component in Next.js
The next/link component is used for client-side navigation in Next.js, making it faster than traditional <a> tags by prefetching pages in the background.
📌 1. Basic Usage of <Link>
Import and use the <Link> component to navigate between pages:
<Link <button onClick={() => router.push("/profile")}>Go to Profile</button>;}
✅ Best for imperative navigation
📌 9. When to Use <Link>?
✔️ For internal navigation between pages
✔️ For better SEO and prefetching
✔️ For avoiding full page reloads