Skip to content

Commit

Permalink
[DataGridPro] Use readonly array result for getTreeDataPath.
Browse files Browse the repository at this point in the history
We do not try to modify the array after receiving it, so let's accept an immutable array.
This is still compatible with existing usage of getTreeDataPath.
  • Loading branch information
pcorpet committed Jan 18, 2024
1 parent c710c86 commit 982d960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ DataGridPremiumRaw.propTypes = {
* Note that all paths must contain at least one element.
* @template R
* @param {R} row The row from which we want the path.
* @returns {string[]} The path to the row.
* @returns {readonly string[]} The path to the row.
*/
getTreeDataPath: PropTypes.func,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export interface DataGridProPropsWithoutDefaultValue<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[];
/**
* Callback fired while a column is being resized.
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
Expand Down

0 comments on commit 982d960

Please sign in to comment.