Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TanStack · Function

getGroupedRowModel

getGroupedRowModel is a deprecated TanStack Table v8 compatibility stub that enables the grouped row model. For current Table APIs, use createGroupedRowModel() in the groupedRowModel feature slot.

How it works

In the current Table API, grouping is configured by registering a grouped-row-model factory in the table's feature slots. The resulting table instance exposes a grouped row model that transforms rows according to grouping state; aggregation can also be applied when the aggregation feature is registered.

Syntax

function getGroupedRowModel<TData>(): RowModelFactory<TData>;

Returns

RowModelFactory<TData>

Key points

  • The legacy function is generic over TData and returns a RowModelFactory<TData>.
  • New code should register createGroupedRowModel in the groupedRowModel feature slot.
  • Grouping is driven by the table's grouping state.
  • Registering row aggregation enables configured aggregate values for grouped rows.
  • Grouping runs after filtering and before sorting in the documented row-model order.

Common mistakes

  • The documented getGroupedRowModel function is a legacy compatibility stub, not the current configuration API.
  • With manual grouping enabled, pre-group the data yourself because the table skips automatic grouping.

Example: Configure client-side grouping

import { createGroupedRowModel } from '@tanstack/table-core'

const features = tableFeatures({
  columnGroupingFeature,
  groupedRowModel: createGroupedRowModel(),
})

Register the grouping feature and its row-model factory in the table features.

When to use it

Modernize grouping configuration

Migrating legacy v8-compatible table code to the current feature-based API.

Client-side row grouping

Grouping client-side data according to the table's grouping state.

Grouped aggregation

Computing aggregate values for grouped rows.

Interview questions

QHow should grouping be configured in the current TanStack Table API?

In the current API, the legacy function is replaced by createGroupedRowModel() registered in the groupedRowModel feature slot. The table then exposes the grouped row model through its instance.

Follow-up: How does server-side grouping differ? Set manualGrouping to true and supply already-grouped rows; the table will not perform client-side grouping.

QWhat does the grouped row model do?

The grouped row model groups rows according to grouping state and can compute aggregate values when the row aggregation feature is also registered. It is one stage in the table's row-model pipeline.

Follow-up: What follows grouping in the pipeline? Sorting, expansion, pagination, and finally the table's final row model can run afterward.

QWhat are the signature and status of getGroupedRowModel?

The legacy signature is getGroupedRowModel<TData>(): RowModelFactory<TData>. Its return type is RowModelFactory<TData>, but the page marks it deprecated and recommends the newer factory.

Follow-up: Why should new code avoid it? It exists only for v8 compatibility with useLegacyTable, while the current API uses feature-based factories.

  • createGroupedRowModel
  • groupedRowModel
  • columnGroupingFeature
  • rowAggregationFeature
  • manualGrouping
  • table.getGroupedRowModel()
  • table.getPreGroupedRowModel()

Source: getGroupedRowModel | TanStack Table React Docs. Checked 2026-10-15.