Skip to content

Conversation

Programming-Seungwan
Copy link

@Programming-Seungwan Programming-Seungwan commented Oct 18, 2025

fix #296

It was using type of like, (args: unknown) => void

So, using scrollTo function like scrollTo(200, 300) was making typescript error.

So, I fixed type like it.

  export function useWindowScroll(): [
    {
      x: number | null;
      y: number | null;
    },
    {
      (xCoord: number, yCoord: number): void;
      (options: ScrollToOptions): void;
    }
  ];

It is based on mdn references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect type definition in useWindowScroll

2 participants