<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@datashaper/react](./react.md) &gt; [useSortedGroups](./react.usesortedgroups.md)

## useSortedGroups() function

Sort top level group headers if the table is grouped, there isn't any column sorted or if the respective column is sorted

<b>Signature:</b>

```typescript
export declare function useSortedGroups(table: ColumnTable, column?: string, sort?: SortDirection, entries?: RowObject[]): RowObject[] | undefined;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  table | ColumnTable |  |
|  column | string | <i>(Optional)</i> |
|  sort | SortDirection | <i>(Optional)</i> |
|  entries | RowObject\[\] | <i>(Optional)</i> |

<b>Returns:</b>

RowObject\[\] \| undefined

RowObject\[\] \| undefined

