Skip to content

Update type definitions for React 19 #28

Description

@SheldonWBM

I can confirm that react-use-draggable-scroll works in React 19.
However, MutableRefObject is deprecated.

A workaround (for TypeScript)

  const refDraggable = useRef<HTMLDivElement>(null);

  const { events } = useDraggable(refDraggable as RefObject<HTMLDivElement>);

Please update react-use-draggable-scroll to change MutableRefObject to RefObject. The useRef hook also requires an argument for better type safety. Since the code has not been updated in three years, this might require forking the project if the maintainer has abandoned it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions