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.
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.
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.