You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add two new built in sort types (TanStack#3235)
* feat(sortTypes): Add string and number sort types
New sort types better serve certain edge cases for columns with string or number values. Number strips out non decimal or numerical value from strings and only sorts what is left. String sorts strings case-insensitively until it reaches a title, and then it will do case-sensitive sort (TanStack#3137).
* docs(useSortBy): Add two new sort types
Add new built-in sort functions 'number' and 'string'
* test(useSortBy): Increase coverage for useSortBy
Add new sort types (number, string) to
certain columns to achieve sufficient coverage.
- Used to compare 2 rows of data and order them correctly.
77
77
- If a **function** is passed, it must be **memoized**. The sortType function should return 1 if rowA is larger, and -1 if rowB is larger. `react-table` will take care of the rest.
78
-
- String options: `basic`, `datetime`, `alphanumeric`. Defaults to `alphanumeric`.
- The resolved function from the this string/function will be used to sort the this column's data.
80
80
- If a `string` is passed, the function with that name located on either the custom `sortTypes` option or the built-in sorting types object will be used.
0 commit comments