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

[Home](./index.md) &gt; [@datashaper/react](./react.md) &gt; [useSortHandling](./react.usesorthandling.md)

## useSortHandling() function

<b>Signature:</b>

```typescript
export declare function useSortHandling(allowSorting: boolean, onColumnHeaderClick?: ColumnClickFunction, defaultSortColumn?: string, defaultSortDirection?: SortDirection): SortParameters;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  allowSorting | boolean |  |
|  onColumnHeaderClick | [ColumnClickFunction](./react.columnclickfunction.md) | <i>(Optional)</i> |
|  defaultSortColumn | string | <i>(Optional)</i> |
|  defaultSortDirection | SortDirection | <i>(Optional)</i> |

<b>Returns:</b>

[SortParameters](./react.sortparameters.md)

