Description
The application currently uses standard HTML <a> tags for internal routing across several pages instead of the Next.js <Link> component.
This is a Next.js anti-pattern that breaks Single Page Application (SPA) routing. When users click these links, the browser performs a full page reload rather than a fast, client-side navigation. This degrades performance, increases server load, and removes the seamless SPA feel of the dashboard.
Affected Files
Based on ESLint (@next/next/no-html-link-for-pages) warnings, the following files are known to contain this issue:
src/app/compare/[users]/page.tsx
src/app/dashboard/settings/page.tsx
src/app/u/[username]/page.tsx
src/components/landing/LandingPage.tsx
(Note: There may be other files affected. A project-wide search for <a> tags pointing to internal routes should be conducted).
Expected Behavior
Internal navigation should be instantaneous without triggering a full browser refresh, preserving client-side state and offering a smooth, optimized user experience.
Steps to Reproduce
- Navigate to the Landing Page, Dashboard Settings, or a Public Profile.
- Click on an internal link (e.g., navigating back to the home page
/ or to an authentication endpoint like /api/auth/signin/github/).
- Observe the browser tab reloading the entire page instead of a smooth SPA transition.
Proposed Solution
- Identify all instances of standard
<a> tags used for internal routes (e.g., routes starting with /).
- Import the Next.js Link component:
import Link from 'next/link';
- Replace the
<a> tags with <Link> components, keeping the href attribute intact.
- Run
npm run lint to verify that the no-html-link-for-pages ESLint warnings have been resolved.
Description
The application currently uses standard HTML
<a>tags for internal routing across several pages instead of the Next.js<Link>component.This is a Next.js anti-pattern that breaks Single Page Application (SPA) routing. When users click these links, the browser performs a full page reload rather than a fast, client-side navigation. This degrades performance, increases server load, and removes the seamless SPA feel of the dashboard.
Affected Files
Based on ESLint (
@next/next/no-html-link-for-pages) warnings, the following files are known to contain this issue:src/app/compare/[users]/page.tsxsrc/app/dashboard/settings/page.tsxsrc/app/u/[username]/page.tsxsrc/components/landing/LandingPage.tsx(Note: There may be other files affected. A project-wide search for
<a>tags pointing to internal routes should be conducted).Expected Behavior
Internal navigation should be instantaneous without triggering a full browser refresh, preserving client-side state and offering a smooth, optimized user experience.
Steps to Reproduce
/or to an authentication endpoint like/api/auth/signin/github/).Proposed Solution
<a>tags used for internal routes (e.g., routes starting with/).import Link from 'next/link';<a>tags with<Link>components, keeping thehrefattribute intact.npm run lintto verify that theno-html-link-for-pagesESLint warnings have been resolved.