Skip to content

Update type definitions for React 19 #28

@SheldonWBM

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.

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