A function that returns a key to use for scroll restoration. This is useful
for custom scroll restoration logic, such as using only the pathname so
that later navigations to prior paths will restore the scroll. Defaults to
location.key. See GetScrollRestorationKeyFunction.
<ScrollRestoration getKey={(location, matches) => { // Restore based on a unique location key (default behavior) returnlocation.key
// Restore based on pathname returnlocation.pathname }} />
OptionalstorageKey?: string
The key to use for storing scroll positions in sessionStorage.
Defaults to "react-router-scroll-positions".
A function that returns a key to use for scroll restoration. This is useful for custom scroll restoration logic, such as using only the pathname so that later navigations to prior paths will restore the scroll. Defaults to
location.key. See GetScrollRestorationKeyFunction.