UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

17 lines (16 loc) 466 B
import { useEvent } from "@1771technologies/lytenyte-core/internal"; export function useRowChildren(source) { const rowChildren = useEvent((id) => { const node = source.tree.rowIdToNode.get(id); if (!node) return []; if (node.kind === "leaf") return []; const ids = []; node.byIndex.forEach((n) => { ids.push(n.row.id); }); return ids; }); return rowChildren; }