Skip to content

Configuration events (onSort, onDragend, onDragstart) aren't typed properly #162

@millansingh

Description

@millansingh

I'm using the React version of this library, and I have noticed that the event handler functions values don't get typed with the type that we're sorting by. I would expect the handlers' param to be typed to the same type as I initialized the hook with, but it's being typed as a generic T only.

Here's a screenshot of my code showing the type error:

Image Image

As you can see, I typed the hook with the ProductSpecification type (such that the array of items should be an array of ProductSpecifications), but when I try to access the values from the handler, they're typed as generic T only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions