React Router API Reference
    Preparing search index...

    Function UNSAFE_useScrollRestorationInternal

    • When rendered inside a RouterProvider, will restore scroll positions on navigations

      Parameters

      • options: { getKey?: GetScrollRestorationKeyFunction; storageKey?: string } = {}

        Options

        • OptionalgetKey?: GetScrollRestorationKeyFunction

          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 subsequent navigations to prior paths will restore the scroll. Defaults to location.key.

        • OptionalstorageKey?: string

          The key to use for storing scroll positions in sessionStorage. Defaults to "react-router-scroll-positions".

      Returns void

      UNSAFE_useScrollRestoration

      framework

      data