perf: wrap link component in NextLink #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why This Improves Performance:
Client-Side Navigation: Using Next.js’ Link component enables client-side transitions, which keep route changes within the app without triggering a full-page reload. This results in faster navigation and smoother user experience. (See Next.js Link documentation)
Prefetching for Faster Loading: Next.js prefetches pages linked with its Link component, loading content in the background while users browse. This allows for near-instant transitions to linked pages, improving perceived performance. (See Next.js Performance Optimization Guide)
Enforced Consistency and Simplified Logic: By requiring href on all Link components, this update removes ambiguity in component behavior, aligns with Next.js best practices, and simplifies navigation logic by focusing on links as navigation elements.