@mitcsutt/kiln-dnd
Version:
Kiln drag and drop: sortable lists, boards, drop zones and grid layouts with one keyboard model and one announcer, rendered through kiln-ui
13 lines (12 loc) • 484 B
JavaScript
import { createContext as e, useContext as t, useEffect as n, useLayoutEffect as r } from "react";
//#region src/core/context.ts
var i = e(null);
function a(e) {
let n = t(i);
if (!n) throw Error(`${e} must be rendered inside <Dnd>. Wrap the draggable items and their drop targets in one <Dnd>.`);
return n;
}
var o = typeof document > "u" ? n : r;
//#endregion
export { i as DndContext, a as useDndController, o as useIsomorphicLayoutEffect };
//# sourceMappingURL=context.js.map