useSortBy
Purpose
The useSortBy hook exposes methods and data for sorting results, internally it is used by the SortBy component.
Usage
The sortOptions
field is an array of all available sort options.
The sortOption
field is the currently selected sort option, by default this is the first sort option.
The setSortOption
method can be used to change the sort option, you must provide the handle
value of one of the sort options.
Signature
Last updated