View as Markdown

API reference: @salmonui/data-grid/engine/tree

flattenTreefunction

import { flattenTree } from '@salmonui/data-grid/engine/tree';
function flattenTree<Row>(roots: readonly Row[], childrenField: string, onIssue?: (issue: TreeIssue) => void): Row[];

Nested rows (childrenField arrays) as one flat pre-order array, rows by reference (never copied). Iterative, so deep trees never overflow the stack; a row that contains itself (a cycle in the nesting) is emitted once and its looping child skipped (onIssue with kind cycle).