fix: improper list data propagation (#240)
This commit is contained in:
@@ -78,13 +78,6 @@ function List<T>({ draggables, itemKey, children, onReordered, gap }: ListProps<
|
|||||||
const transformFunction = children;
|
const transformFunction = children;
|
||||||
|
|
||||||
useEffect(() => {
|
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));
|
setItems(wrap(draggables, itemKey));
|
||||||
}, [draggables]);
|
}, [draggables]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user