Skip to contents

Usage

ScrollRestoration(...)

Arguments

...

Props to pass to element. Notable props: getKey (a JS function to compute the scroll key from the location) and storageKey (Character, custom sessionStorage key).

Value

A ScrollRestoration component.

Details

Emulates the browser's scroll restoration on location changes after loaders have completed. Place once inside the root layout of a data router app. Requires a data router (createBrowserRouter, createHashRouter, etc.).