Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
setGlobalFilter,
} = tableInstanceRef.current;

useEffect(() => {
if (process.env.NODE_ENV === 'development' && headerGroups.length > 1) {
console.error(
'[AnalyticalTable] Nested column headers are not supported. Please flatten your column definitions.',
);
}
}, [headerGroups.length]);

const tableState: AnalyticalTableState = tableInstanceRef.current.state;
const { popInColumns, triggerScroll } = tableState;
const isGrouped = !!tableState.groupBy.length;
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/components/AnalyticalTable/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export interface TableInstance {
groupedFlatRows?: RowType[];
groupedRows?: RowType[];
groupedRowsById?: Record<string, RowType>;
/**
* Nested column headers are not supported. This array must only contain a single header group.
*/
headerGroups: Record<string, any>[];
headers: ColumnType[];
initialRows: RowType[];
Expand Down
Loading