Skip to content

Commit 00cf41d

Browse files
committed
chore: 🤖 upgrade @dnd-kit/core ^6
close#6
1 parent a35019c commit 00cf41d

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

package-lock.json

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@
7878
"tslib": "^2.3.1",
7979
"typescript": "^4.6.3"
8080
},
81-
"dependencies": {
82-
"@dnd-kit/core": "^5.0.3",
83-
"@dnd-kit/sortable": "^6.0.1"
84-
},
8581
"publishConfig": {
8682
"registry": "https://registry.npmjs.org"
8783
},
@@ -98,5 +94,9 @@
9894
"Sortable List",
9995
"Drag and Drop",
10096
"@dnd-kit"
101-
]
97+
],
98+
"dependencies": {
99+
"@dnd-kit/core": "^6.1.0",
100+
"@dnd-kit/sortable": "^8.0.0"
101+
}
102102
}

stories/SortableList.stories.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useState } from '@storybook/addons';
2-
import { Meta } from '@storybook/react';
32
import React from 'react';
43

54
import {
@@ -12,7 +11,7 @@ import {
1211
export default {
1312
component: SortableList,
1413
title: 'components/SortableList',
15-
} as Meta;
14+
};
1615

1716
const DragHandler = (props) => (
1817
<div
@@ -81,6 +80,22 @@ export const ChildrenExample: React.VFC = () => {
8180
);
8281
};
8382

83+
const data = Array.from({ length: 30 }, (_, index) => ({
84+
id: `${index}`,
85+
name: `Item ${index}`,
86+
}));
87+
88+
export const DraggingScrollingExample: React.VFC = () => {
89+
const [items, setItems] = useState<SortableItemProps[]>(data);
90+
return (
91+
<SortableList
92+
items={items}
93+
setItems={setItems}
94+
itemRender={({ item }: ItemRenderProps) => <Item name={item.name} />}
95+
/>
96+
);
97+
};
98+
8499
export const DragHandlerExample: React.VFC = () => {
85100
const [items, setItems] = useState<SortableItemProps[]>([
86101
{ id: '1', name: 'Item 1' },

0 commit comments

Comments
 (0)