Skip to content

Link click - NextJS and React/Router #6

@richi-coder

Description

@richi-coder

I have noticed kind of difference between both link components: NextJs Link and Router Link.

Once a Router Link is clicked, a response can be seen by the user, since it changes the page inmediately. Some time it will take for data being fetched after page changes.

In other context, once a NextJS Link is clicked, it takes a time for a response to be shown in the UI meanwhile NextJS fetches data to "avoid refreshing the whole page". As data arrives to the client, the wanted page renders to the screen.

The difference:

Router reacts first and waits later.
NextJS waits first and reacts later.

This can be perceived with slow networks. Offering reactive events to the user on SPAs developed with Router, and more sensitive feeling, while those NextJS based Multi Page Apps having the user with uncertainty and clicking the link many times awaiting for a UI reaction.

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