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

Jay

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.

Ali AlHussain

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324128458&siteId=291194637