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
4 changes: 2 additions & 2 deletions packages/react-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
"build": "tsdown"
},
"dependencies": {
"@tanstack/react-store": "^0.11.0",
"@tanstack/table-core": "workspace:*"
"@tanstack/react-store": "^0.11.0"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^5.8.16",
Expand All @@ -75,6 +74,7 @@
"react": "^19.2.7"
},
"peerDependencies": {
"@tanstack/table-core": "workspace:*",
"react": ">=18"
}
}
6 changes: 6 additions & 0 deletions packages/table-core/src/core/columns/constructColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,11 @@ export function constructColumn<
column.id = `${String(id)}`
column.parent = parent

// Initialize instance-specific data (e.g., caches) for features that need it
const features = Object.values(table._features)
for (let i = 0; i < features.length; i++) {
features[i]!.initColumnInstanceData?.(column)
}

return column as Column<TFeatures, TData, TValue>
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface ColumnDef_ColumnGrouping<
/**
* Specify a value to be used for grouping rows on this column. If this option is not specified, the value derived from `accessorKey` / `accessorFn` will be used instead.
*/
getGroupingValue?: (row: TData) => any
getGroupingValue?: (row: TData, index: number) => any
}

export interface Column_ColumnGrouping<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export function row_getGroupingValue<
if (row._groupingValuesCache) {
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(
row.original,
row.index,
)
}

Expand Down