Skip to content

Commit 3c2608a

Browse files
committed
refactor: remove arg of onExternalDrop
1 parent c1b6286 commit 3c2608a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/HeTree.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ export interface HeTreeProps<T extends Record<string, any>> extends Partial<type
6666
onDragStart?: (e: React.DragEvent<HTMLElement>, stat: Stat<T>) => void,
6767
onDragOver?: (e: React.DragEvent<HTMLElement>, stat: Stat<T>, isExternal: boolean) => void,
6868
onExternalDragOver?: (e: React.DragEvent<HTMLElement>) => boolean,
69-
onExternalDrop?: (e: React.DragEvent<HTMLElement>, parentStat: Stat<T> | null, index: number, isExternal: boolean) => void,
70-
/**
71-
* Call on drag end in the window. If you use draggedStat in the callback, it will be undefined if onExternalDrop alreay triggered.
72-
*/
69+
onExternalDrop?: (e: React.DragEvent<HTMLElement>, parentStat: Stat<T> | null, index: number) => void,
7370
onDragEnd?: (e: React.DragEvent<HTMLElement>, stat: Stat<T>, isOutside: boolean) => void | boolean,
7471
onChange: (data: T[]) => void,
7572
onDragOpen?: (stat: Stat<T>) => void,
@@ -486,7 +483,7 @@ export function useHeTree<T extends Record<string, any>>(
486483
e.preventDefault();
487484
if (isExternal) {
488485
const { index: targetIndexInSiblings } = placeholder
489-
props.onExternalDrop?.(e, placeholder.parentStat, targetIndexInSiblings, isExternal)
486+
props.onExternalDrop?.(e, placeholder.parentStat, targetIndexInSiblings)
490487
reset()
491488
}
492489
}

0 commit comments

Comments
 (0)