Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "No-op on Current Page" for Link Component #39

Open
niefufeng opened this issue Oct 16, 2024 · 0 comments
Open

Implement "No-op on Current Page" for Link Component #39

niefufeng opened this issue Oct 16, 2024 · 0 comments

Comments

@niefufeng
Copy link

Issue Description

The Link component provided by the next-view-transitions package currently lacks a crucial feature: the ability to remain inactive when users click on a link pointing to the current page. This behavior diverges from the native Next.js Link component, which elegantly handles such interactions without triggering unnecessary page refreshes or reloads.

Critical Concern: The current implementation inadvertently causes an extraneous network request and a noticeable "flash" of page elements when clicking a link to the current page. This not only impacts the user experience but also potentially affects performance.

Desired Behavior

We propose enhancing the next-view-transitions Link component to:

  1. Gracefully handle clicks on links pointing to the current page without initiating any page transitions or reloads.
  2. Eliminate superfluous network requests in these scenarios.
  3. Prevent any visual disturbances, such as page element flickering.
  4. Maintain consistency with the native Next.js Link component's behavior.

Additional Context

  • Next.js version: 15.0.0-rc.0
  • next-view-transitions version: 0.3.2

This enhancement is crucial for maintaining a seamless user experience, particularly for projects migrating from the native Next.js Link component to next-view-transitions. Addressing this issue will significantly improve both the performance and user experience of applications utilizing this package.

We appreciate your attention to this matter and look forward to any contributions or discussions that may arise from this proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant