Skip to content

Commit eac4b0a

Browse files
authored
Revert "fix(Table): fix flattenData function (#413)" (#417)
This reverts commit 7606bc9.
1 parent 86f12a0 commit eac4b0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/flattenData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import type { RowDataType } from '../@types/common';
99
function flattenData<Row extends RowDataType>(treeData: readonly Row[]) {
1010
const flattenItems: Row[] = [];
1111

12-
function loop(treeData: readonly Row[], parentNode: Row | null) {
12+
function loop(treeData, parentNode) {
1313
if (!Array.isArray(treeData)) {
1414
return;
1515
}
1616

1717
treeData.forEach(rowData => {
18+
rowData[PARENT_KEY] = parentNode;
1819
flattenItems.push({
19-
...rowData,
20-
[PARENT_KEY]: parentNode
20+
...rowData
2121
});
2222
if (rowData.children) {
2323
loop(rowData.children, rowData);

0 commit comments

Comments
 (0)