Skip to content

Commit

Permalink
refactor: calling functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Aug 24, 2023
1 parent 0f0d874 commit 590859d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/DraggableList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const DraggableList = <T extends DefaultItemProps>({
endIndex: result.destination.index,
});

onDragEndCallback && onDragEndCallback({ data: reorderedItems });
onDragEndCallback?.({ data: reorderedItems });
},
[items, onDragEndCallback]
);
Expand All @@ -56,8 +56,7 @@ export const DraggableList = <T extends DefaultItemProps>({
if (!result.destination) {
return;
}
onPlaceholderIndexChange &&
onPlaceholderIndexChange(result.destination.index);
onPlaceholderIndexChange?.(result.destination.index);
},
[onPlaceholderIndexChange]
);
Expand Down

0 comments on commit 590859d

Please sign in to comment.