这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@niefufeng

Description

@niefufeng

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions