Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BorisTheTripper's avatar

Where does <Link preserveScroll /> preserve scroll?

I can't tell from the the docs what <Link preserveScroll /> is supposed to do. Will it preserve the scrolling position on the current page when I navigate back to it? Or will it preserve it for the page that the Link refers to?

0 likes
1 reply
Niush's avatar

Suppose you are on a page with a long paginated table (may be per page 500).

Then you scroll to the bottom to click the Link and go to the Next page.

If there is <Link preserveScroll /> then, in the next page i.e. /users?page=2 the scroll position will be preserved (i.e. you will ideally remain at the bottom of the page).

If there is NO preserveScroll, the next page /users?page=2 will automatically send you to the top of page (like default browser behavior when clicking <a href />).

Please or to participate in this conversation.