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