Skip to content

Commit

Permalink
docs: add sort by info (#2540)
Browse files Browse the repository at this point in the history
Co-authored-by: Will McCambley <[email protected]>
  • Loading branch information
WillCMcC and Will McCambley authored Jul 16, 2020
1 parent cf3a6e8 commit bb9506f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/pages/docs/api/useSortBy.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The following options are supported on any `Column` object passed to the `column
- This may be useful in situations where positive and negative connotation is inverted, eg. a Golfing score where a lower score is considered more positive than a higher one.
- `sortType: String | Function(rowA: <Row>, rowB: <Row>, columnId: String, desc: Bool)`
- Used to compare 2 rows of data and order them correctly.
- If a **function** is passed, it must be **memoized** and it should always return the data in **ascending** order. `react-table` will take care of the rest.
- 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.
- 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.
- 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.
Expand Down

1 comment on commit bb9506f

@vercel
Copy link

@vercel vercel bot commented on bb9506f Jul 16, 2020

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.