UNPKG

@progress/kendo-react-gantt

Version:

React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package

33 lines (32 loc) 1.08 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as r from "react"; import { useGanttViewTasksContext as u } from "../context/GanttViewContext.mjs"; import { STORE_ACTION as a } from "./useDictionaryStore.mjs"; import { useIsomorphicLayoutEffect as c } from "@progress/kendo-react-common"; const l = (m, o, n, f) => { const e = r.useRef(null), [, s] = u(); r.useImperativeHandle(e, () => ({ element: f.current, dataItem: m })), r.useImperativeHandle(n, () => e.current), c(() => { const t = e.current; if (t) return s({ type: a.add, itemRef: t, id: o }), () => { s({ type: a.remove, itemRef: t, id: o }); }; }); }; export { l as useGanttTask };