-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Hi, I'm using dnd-kit in a TypeScript project, and would like to strongly type the data property attached to Draggable objects.
I tried extending the interface, the way other libraries sometimes implement it, but it didn't work.
declare module '@dnd-kit/core/dist/store/types' {
export interface Active {
data: DataRef<MyDataType>;
}
}
TypeScript gives an error Subsequent property declarations must have the same type. Property 'data' must be of type 'DataRef<AnyData>', but here has type 'DataRef<MyDataType>'.
It would be great if a future version could expose an API for either extending the interface, or at passing generics to the DnDContext component.
quantrung
Metadata
Metadata
Assignees
Labels
No labels