MCPcopy
hub / github.com/clauderic/dnd-kit / App

Function App

apps/stories-solid/stories/Sortable/SortableDynamicFeedbackApp.tsx:36–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36export default function App() {
37 const [items, setItems] = createSignal(createRange(100));
38
39 return (
40 <DragDropProvider
41 onDragEnd={(event) => {
42 setItems((items) => move(items, event));
43 }}
44 >
45 <ul class="list">
46 <For each={items()}>
47 {(id, index) => <Sortable id={id} index={index()} />}
48 </For>
49 </ul>
50 </DragDropProvider>
51 );
52}
53
54function createRange(length: number) {
55 return Array.from({length}, (_, i) => i + 1);

Callers

nothing calls this directly

Calls 3

moveFunction · 0.90
createRangeFunction · 0.70
indexFunction · 0.70

Tested by

no test coverage detected