Skip to content

Commit

Permalink
[data grid] Use readonly array result for getTreeDataPath (#11743)
Browse files Browse the repository at this point in the history
Co-authored-by: Rom Grk <romgrk.cc@gmail.com>
  • Loading branch information
pcorpet and romgrk committed Aug 22, 2024
1 parent 7aaecf5 commit 9d24a7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/x-data-grid-pro/src/models/dataGridProProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ interface DataGridProRegularProps<R extends GridValidRowModel> {
* @param {R} row The row from which we want the path.
* @returns {string[]} The path to the row.
*/
getTreeDataPath?: (row: R) => string[];
getTreeDataPath?: (row: R) => readonly string[];
}

export interface DataGridProPropsWithoutDefaultValue<R extends GridValidRowModel = any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('<DataGridPro /> - Tree data', () => {
]);
setProps({
getTreeDataPath: (row) => [...row.name.split('.').reverse()],
} as DataGridProProps);
} as Pick<DataGridProProps, 'getTreeDataPath'>);
expect(getColumnValues(1)).to.deep.equal([
'A',
'A.A',
Expand Down

0 comments on commit 9d24a7b

Please sign in to comment.