Home > Back-end >  Is it possible to disable scrolling on all NextJS <Link>s by default?
Is it possible to disable scrolling on all NextJS <Link>s by default?

Time:03-20

I'm building a site with NextJS and using a fade in and out page transition. I manually scroll the page to the top in between the out and in transitions so the user never sees the jump.

But to do this I am having to set scroll="false" on all <Link> tags.

I am wondering if there's a way to set scroll to false by default on all Link tags, but I haven't been able to find anything on this subject.

CodePudding user response:

One way is to make a custom Link component and use scroll="false" on it and import it everywhere you use links.

  • Related