Test out Support scroll: false for Link component for app router #51869
#146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I continue to find this repo to be a helpful tool in evaluating NextJS features/fixes. Recently, vercel/next.js#51869 landed in
canary
, which adds support forscroll={false}
in the app router. I was curious whether that was enough to get this demo working, and it seems like it is (no longer getting scroll position reset to the top of the page, browser back button is returning to the correct spot in the feed). I figured I would share the code in case you or anyone else was curious.13.4.9-canary.1
next/font
and remove unusedexperimental
config entries)router.replace(href, {scroll: false}
and remove therouter.replace
(not sure if we still need this for anything)Code
component as this was causing hydration errors that I didn't know how to fix.Of course, these changes still don't address the performance issue you noted earlier (that each page is re-fetching all prior pages). I guess we are waiting on a new RSC primitive to help with that.