gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/components/ui/sortable/use-sortable-item.ts · v0.5.1
Source
1 0178858 Dawsh 2y ago import React from "react";
2 0178858 Dawsh 2y ago import { SortableItemContext} from "./context";
3 0178858 Dawsh 2y ago
4 0178858 Dawsh 2y ago export function useSortableItem() {
5 0178858 Dawsh 2y ago const context = React.useContext(SortableItemContext)
6 0178858 Dawsh 2y ago
7 0178858 Dawsh 2y ago if (!context) {
8 0178858 Dawsh 2y ago throw new Error("useSortableItem must be used within a SortableItem")
9 0178858 Dawsh 2y ago }
10 0178858 Dawsh 2y ago
11 0178858 Dawsh 2y ago return context
12 0178858 Dawsh 2y ago }