useWindowScroll

Read the scroll position of the window and scroll it.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Read the scroll position and go back to the top.

APIs

useWindowScroll

const useWindowScroll = () => [
  { x: number; y: number },
  (position: { x?: number; y?: number }) => void,
]
Edit this page on GitHub