We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a63645 commit 3b3e8a9Copy full SHA for 3b3e8a9
src/components/ListTable.js
@@ -213,7 +213,12 @@ const generateRowsData = (bodyRowNodes, columns) => {
213
const rowNodes = bodyRowNodes.map((node) => node?.children[0]?.children ?? []);
214
const rows = rowNodes.map((rowNode) => {
215
return rowNode.reduce((res, columnNode, colIndex) => {
216
- res[columns[colIndex].accessorKey] = (
+ const column = columns[colIndex];
217
+ if (!column) {
218
+ console.warn(`Row has too many items (index ${colIndex}) for table with ${columns.length} columns`);
219
+ return res;
220
+ }
221
+ res[column?.accessorKey ?? colIndex] = (
222
<>
223
{columnNode.children.map((cellNode, index) => (
224
<ComponentFactory key={index} nodeData={cellNode} />
0 commit comments