Skip to content

Commit

Permalink
fix docs claim about default sorting function (#947)
Browse files Browse the repository at this point in the history
The default sorting function is `basic`, not `alphanumeric` as the docs
were claiming.
  • Loading branch information
andreimatei committed Jan 18, 2024
1 parent 0799d4b commit ec17f00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/material-react-table-docs/pages/docs/guides/sorting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const table = useMaterialReactTable({

### Default Sorting Features

Client-side sorting is enabled by default. When sorting is toggled on for a column, the table will be sorted by an [`alphanumeric` sorting algorithm](https://tanstack.com/table/v8/docs/api/features/sorting#sorting-functions) by default.
Client-side sorting is enabled by default. When sorting is toggled on for a column, the table will be sorted by the [`basic` sorting algorithm](https://tanstack.com/table/v8/docs/api/features/sorting#sorting-functions) by default.

#### Multi-Sorting

Expand Down Expand Up @@ -137,7 +137,7 @@ By default, columns with `string` datatypes will sort alphabetically in ascendin

### Sorting Functions

By default, Material React Table will use an `alphanumeric` sorting function for all columns.
By default, Material React Table will use the `basic` sorting function for all columns.

There are six built-in sorting functions you can choose from: ` alphanumeric`, `alphanumericCaseSensitive`, `text`, `textCaseSensitive`, `datetime`, and `basic`. You can learn more about these built-in sorting functions in the [TanStack Table Sorting API docs](https://tanstack.com/table/v8/docs/api/features/sorting#sorting-functions).

Expand Down Expand Up @@ -165,7 +165,7 @@ const columns = [
{
accessorKey: 'name',
header: 'Name',
sortingFn: 'textCaseSensitive', //use the built-in textCaseSensitive sorting function instead of the default alphanumeric sorting function
sortingFn: 'textCaseSensitive', //use the built-in textCaseSensitive sorting function instead of the default basic sorting function
},
{
accessorKey: 'age',
Expand Down

2 comments on commit ec17f00

@vercel
Copy link

@vercel vercel bot commented on ec17f00 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ec17f00 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.