From 590859dad2e54fe94e3e140a026f6e1bd0d1d01c Mon Sep 17 00:00:00 2001 From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:37:54 +0200 Subject: [PATCH] refactor: calling functions --- src/DraggableList/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/DraggableList/index.tsx b/src/DraggableList/index.tsx index e386214..8d231c7 100644 --- a/src/DraggableList/index.tsx +++ b/src/DraggableList/index.tsx @@ -46,7 +46,7 @@ export const DraggableList = ({ endIndex: result.destination.index, }); - onDragEndCallback && onDragEndCallback({ data: reorderedItems }); + onDragEndCallback?.({ data: reorderedItems }); }, [items, onDragEndCallback] ); @@ -56,8 +56,7 @@ export const DraggableList = ({ if (!result.destination) { return; } - onPlaceholderIndexChange && - onPlaceholderIndexChange(result.destination.index); + onPlaceholderIndexChange?.(result.destination.index); }, [onPlaceholderIndexChange] );