Skip to content

Commit 154d393

Browse files
authored
Merge pull request #2085 from dxc-technology/jialecl-datagridFix
added check before calling function
2 parents fb8d7fe + 7da2893 commit 154d393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/lib/src/data-grid/DataGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const DxcDataGrid = ({
157157

158158
const onRowsChange = (newRows: GridRow[] | HierarchyGridRow[] | ExpandableGridRow[]) => {
159159
// call function to change rows, like when they have been edited
160-
onGridRowsChange(newRows);
160+
if (typeof onGridRowsChange === "function") onGridRowsChange(newRows);
161161
};
162162

163163
const sortedRows = useMemo((): readonly GridRow[] => {

0 commit comments

Comments
 (0)