fix: improper list data propagation (#240)

This commit is contained in:
Samuel Gunter
2024-09-30 19:16:47 -05:00
committed by GitHub
parent 0ab83efd47
commit 149fda3b72

View File

@@ -78,13 +78,6 @@ function List<T>({ draggables, itemKey, children, onReordered, gap }: ListProps<
const transformFunction = children;
useEffect(() => {
// check if the draggables content has *actually* changed
if (
draggables.length === items.length &&
draggables.every((element, index) => itemKey(element) === items[index]?.id)
) {
return;
}
setItems(wrap(draggables, itemKey));
}, [draggables]);