UNPKG

@1771technologies/lytenyte-pro

Version:

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

13 lines (12 loc) 405 B
import { useEvent } from "@1771technologies/lytenyte-core/internal"; export function useRowSiblings(tree) { const rowChildren = useEvent((id) => { const node = tree.rowIdToNode.get(id); const parent = node?.parent; if (!parent) return []; const ids = [...parent.children.values()].map((x) => x.row.id); return ids; }); return rowChildren; }