react-data-grid
react-data-grid copied to clipboard
Error encountered when decreasing the number of columns using a filter
Describe the bug
I am not sure that my approach is the correct one, but I tried to add a select that works as a filter for the visible columns. Whenever the number of columns is reduced I get this error:
It seems that the issue is caused by an undefined column added to rawColumns2:
To Reproduce
- I filtered the columns before passing them as a prop to the data grid based on the values of a multiple select input
- By default all options are selected and unselecting any option to filter out the column from the ones passed to the data grid causes this error.
let expectedColumns = columns
.filter((column) => visibleColumns.includes(column.name))
.map((column) => {
return (column);
});
Expected behavior
The rawColumn should be ignored if undefined.
Environment
react-data-gridversion: 7.0.0-beta.44react/react-domversion: ^18.2.0