From d338e66cc0507f27606154b39c70d1f43b673ad8 Mon Sep 17 00:00:00 2001 From: Sudhanshu Dasgupta Date: Wed, 31 Jul 2024 11:51:20 +0530 Subject: [PATCH] fix(bug): unassign items in transferlist Signed-off-by: Sudhanshu Dasgupta --- src/custom/TransferModal/TransferList/TransferList.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/custom/TransferModal/TransferList/TransferList.tsx b/src/custom/TransferModal/TransferList/TransferList.tsx index 0d596dd1..ffaea425 100644 --- a/src/custom/TransferModal/TransferList/TransferList.tsx +++ b/src/custom/TransferModal/TransferList/TransferList.tsx @@ -105,10 +105,8 @@ function TransferList({ React.useEffect(() => { assignedData(right); - const idsToRemove = new Set(right.map((item: { id: number }) => item.id)); - const filteredLeft = assignableData.filter((item) => !idsToRemove.has(item.id)); - setLeft(filteredLeft); - }, [right, assignableData, assignedData]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [right]); React.useEffect(() => { const handleScroll = (entries: IntersectionObserverEntry[]) => {