The onCardDragEnd event of the UncontrolledBoard returns four parameters even the typescript signature is described as:
export type OnDragEndNotification<TSubject> = (subject: TSubject, source: OnDragEnd<TSubject>["source"], destination: OnDragEnd<TSubject>["destination"]) => void
Expected Arguments
(subject, source, destination)
Actual Arguments
(board, subject, source, destination)
Looking at the code it seems like the reorderedBoard is mistakenly added to the callback as first argument.
If this was intended, then the signature should be fixed by adding the board as first argument.
|
// @ts-expect-error TS(7031) FIXME: Binding element 'source' implicitly has an 'any' t... Remove this comment to see the full error message |
|
const handleOnDragEnd = ({ source, destination, subject }, { moveCallback, notifyCallback }) => { |
|
const reorderedBoard = moveCallback(board, source, destination) |
|
when(notifyCallback)((callback) => callback(reorderedBoard, subject, source, destination)) |
|
setBoard(reorderedBoard) |
|
} |
The
onCardDragEndevent of theUncontrolledBoardreturns four parameters even the typescript signature is described as:Expected Arguments
(subject, source, destination)Actual Arguments
(board, subject, source, destination)Looking at the code it seems like the
reorderedBoardis mistakenly added to the callback as first argument.If this was intended, then the signature should be fixed by adding the board as first argument.
react-kanban/src/features/board/components/Uncontrolled.tsx
Lines 36 to 41 in cedfe81