Skip to content

Commit

Permalink
[DataGrid] Fix undefined slot values (#10934)
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk authored Nov 8, 2023
1 parent 98debeb commit 35f9dd9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/grid/x-data-grid/src/internals/utils/computeSlots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,14 @@ export function computeSlots<SlotComponents extends object>({
return defaultSlots;
}

return { ...defaultSlots, ...overrides };
const result = { ...defaultSlots };
Object.keys(overrides).forEach((key) => {
const k = key as keyof typeof overrides;

if (overrides[k] !== undefined) {
result[k] = overrides[k] as any;
}
});

return result;
}

0 comments on commit 35f9dd9

Please sign in to comment.