react-router
react-router copied to clipboard
`useElementScrollRestoration`
First pass based on https://github.com/remix-run/react-router/discussions/9495. @ryanflorence will have feedback and I'm sure it'll change.
useScrollRestoration (and <ScrollRestoration />, which relies on it) only allows scroll restoration at the window level. This does not work if the scrolling container is something other than the full page, e.g., a 2x2 grid layout where the bottom right cell is the scrolling content pane. This change preserves the current API and behavior of useScrollRestoration while adding a new hook useElementScrollRestoration, which allows the caller to specify the ID of the scrolling container to use instead of window.
⚠️ No Changeset found
Latest commit: aa03990eacab1f8902f525f927e91f0a15ef1a89
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@david-crespo Thank you for putting this together! I've been trying to do some housekeeping on the repo to start off 2023 and now that we've finished the "6.4 into Remix" work and things have settled down a bit. I'm going to close this PR until the linked discussion comes around and we can re-open when needed.